From b20671cd6cd4bb62a4d1d9631dbe9210a60a8059 Mon Sep 17 00:00:00 2001 From: Naren Dasan Date: Mon, 25 May 2020 00:06:14 -0700 Subject: [PATCH] fix(aten::_convolution): Pass dummy bias when there is no bias Signed-off-by: Naren Dasan Signed-off-by: Naren Dasan --- core/conversion/converters/impl/conv_deconv.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/conversion/converters/impl/conv_deconv.cpp b/core/conversion/converters/impl/conv_deconv.cpp index 2cc88779c8..37cf3ff3ad 100644 --- a/core/conversion/converters/impl/conv_deconv.cpp +++ b/core/conversion/converters/impl/conv_deconv.cpp @@ -1,3 +1,5 @@ +#include "torch/torch.h" + #include "core/util/prelude.h" #include "core/conversion/converters/converters.h" @@ -50,7 +52,8 @@ auto conv_registrations = RegisterNodeConversionPatterns() Weights b(ctx, args[2].unwrapToTensor()); conv = ctx->net->addConvolutionNd(*in, w.num_output_maps, w.kernel_shape, w.data, b.data); } else { - conv = ctx->net->addConvolutionNd(*in, w.num_output_maps, w.kernel_shape, w.data, Weights().data); + Weights b(ctx, torch::zeros(args[1].unwrapToTensor().sizes()[0])); + conv = ctx->net->addConvolutionNd(*in, w.num_output_maps, w.kernel_shape, w.data, b.data); } TRTORCH_CHECK(conv, "Unable to create convolution layer from node: " << *n);