Skip to content

Commit

Permalink
fix(aten::_convolution): Pass dummy bias when there is no bias
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Dasan <[email protected]>
Signed-off-by: Naren Dasan <[email protected]>
  • Loading branch information
narendasan committed May 25, 2020
1 parent 630b615 commit b20671c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/conversion/converters/impl/conv_deconv.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "torch/torch.h"

#include "core/util/prelude.h"
#include "core/conversion/converters/converters.h"

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b20671c

Please sign in to comment.