Skip to content

Commit

Permalink
Extract channels from weight shape for conv2d. (#6805)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwfromm authored Oct 31, 2020
1 parent 50fc938 commit ceef616
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/contrib/tensorrt/tensorrt_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class Conv2DOpConverter : public TensorRTOpConverter {
auto str_dilation = params->node.GetAttr<std::vector<std::string>>("dilation");
auto str_padding = params->node.GetAttr<std::vector<std::string>>("padding");
int groups = std::stoi(params->node.GetAttr<std::vector<std::string>>("groups")[0]);
int channels = std::stoi(params->node.GetAttr<std::vector<std::string>>("channels")[0]);
int channels = weight_shape[0];
// TRT conv2d op doesn't support asymmetric padding before 5.1, so we
// workaround by adding a padding layer before the pooling op.
nvinfer1::DimsHW prepadding, postpadding;
Expand Down
1 change: 0 additions & 1 deletion tests/python/contrib/test_tensorrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def get_graph(
out = relay.nn.conv2d(
x,
kernel,
channels=k_shape[0],
kernel_size=k_shape[2:4],
groups=groups,
padding=padding,
Expand Down

0 comments on commit ceef616

Please sign in to comment.