Skip to content

Commit b20671c

Browse files
committed
fix(aten::_convolution): Pass dummy bias when there is no bias
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 630b615 commit b20671c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/conversion/converters/impl/conv_deconv.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "torch/torch.h"
2+
13
#include "core/util/prelude.h"
24
#include "core/conversion/converters/converters.h"
35

@@ -50,7 +52,8 @@ auto conv_registrations = RegisterNodeConversionPatterns()
5052
Weights b(ctx, args[2].unwrapToTensor());
5153
conv = ctx->net->addConvolutionNd(*in, w.num_output_maps, w.kernel_shape, w.data, b.data);
5254
} else {
53-
conv = ctx->net->addConvolutionNd(*in, w.num_output_maps, w.kernel_shape, w.data, Weights().data);
55+
Weights b(ctx, torch::zeros(args[1].unwrapToTensor().sizes()[0]));
56+
conv = ctx->net->addConvolutionNd(*in, w.num_output_maps, w.kernel_shape, w.data, b.data);
5457
}
5558

5659
TRTORCH_CHECK(conv, "Unable to create convolution layer from node: " << *n);

0 commit comments

Comments
 (0)