Skip to content

Commit

Permalink
[Relay][Frontend][Onnx] Small bug fix for Conv1D imports. (#5995)
Browse files Browse the repository at this point in the history
* Fix autopad bug in onnx importer for conv1d.

* Fix output shape in test.

* Undo commented out lines oops.
  • Loading branch information
jwfromm authored Jul 6, 2020
1 parent 67a7497 commit a64feed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions python/tvm/relay/op/nn/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def conv1d(data,
strides = (strides, )
if isinstance(dilation, int):
dilation = (dilation, )
if isinstance(padding, int):
padding = (padding, padding)
padding = get_pad_tuple1d(padding)
return _make.conv1d(data, weight, strides, padding, dilation,
groups, channels, kernel_size, data_layout,
kernel_layout, out_layout, out_dtype)
Expand Down
9 changes: 9 additions & 0 deletions tests/python/frontend/onnx/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,6 +2180,15 @@ def repeat(N, D):
repeat(1, D),
repeat(1, D),
auto_pad="SAME_UPPER")
# Convolution with valid autopadding
verify_conv((1, 1) + repeat(5, D),
(1, 1) + repeat(3, D),
(1, 1) + repeat(3, D),
None,
repeat(3, D),
repeat(1, D),
repeat(1, D),
auto_pad="VALID")
# Convolution with unset padding
verify_conv((1, 1) + repeat(5, D),
(1, 1) + repeat(3, D),
Expand Down

0 comments on commit a64feed

Please sign in to comment.