[Relay][Frontend][Torch] fix a typo mistake in nonzero_numpy - #16390
Conversation
0c20c01 to
10926f8
Compare
|
@junrushao @t-vi Do you think this change is appropriate? Can you help me review it? |
|
|
||
| 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) |
| """Module that performs nonzero""" | ||
|
|
||
| def __init__(self): | ||
| super().__init__() |
There was a problem hiding this comment.
You don't actually need this init, and in the test also the docstring.
Also I'd probably make the class definition local to the test to have it all in one place.
| import_input = [("input0", (2, 10)), ("input1", (2, 10))] | ||
| relay_model_ir, relay_model_params = tvm.relay.frontend.from_pytorch( | ||
| traced_torch_model, import_input | ||
| ) |
There was a problem hiding this comment.
I'd prefer the test to go in one of the other files (e.g. test_forward.py).
Also, I think it might be best to add a check that PyTorch and TVM actually give the same result (like the other tests in test_forward.py).
There was a problem hiding this comment.
I see there is a test "test_forward_nonzero" (test_forward.py:4435). added a line there
t-vi
left a comment
There was a problem hiding this comment.
Thank you for the fix, I think there might be improvements to the testing.
10926f8 to
c3e5663
Compare
nonzero_numpy is not working correctly #16389