Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,7 @@ def nonzero(self, inputs, input_types, is_numpy_style=False):
return ret

def nonzero_numpy(self, inputs, input_types):
return self.nonzero(inputs, input_types, is_numpy_style=False)
return self.nonzero(inputs, input_types, is_numpy_style=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!


def scatter(self, inputs, input_types):
assert len(inputs) == 4 or len(inputs) == 5, (
Expand Down
1 change: 1 addition & 0 deletions tests/python/frontend/pytorch/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -4445,6 +4445,7 @@ def forward(self, data):

inp = torch.Tensor(np.array([[0, 1, 0], [2, 0, 9], [-1, -1, 0]]).astype("float32"))
verify_trace_model(Nonzero(), [inp], ["llvm"])
verify_trace_model(Nonzero(as_tuple=True), [inp], ["llvm"])


def test_forward_scatter():
Expand Down