-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing grid lowering #2686
Removing grid lowering #2686
Conversation
PR #2682 seems to adddress partially the above. |
93f7316
to
d6190f9
Compare
|
||
def forward(self, x): | ||
grid = torch.randint(-1, 1, dim_shape, dtype=torch.float32) | ||
return self.grid_sampler_op(x, grid, grid_sampler_aten_ops[op_name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this need to be grid_sampler_aten_ops[op_name](x, grid)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gs-olive yes it could be but then in that case it would be something like-
def test_grid(self, _, op_name, input_shape, dim_shape, padding_mode, interpolation_mode, align_corners):
class TestModule(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
grid = torch.randint(-1, 1, dim_shape, dtype=torch.float32)
return grid_sampler_aten_ops[op_name](x, grid, padding_mode, interpolation_mode, align_corners)
inputs = [torch.randn(input_shape, dtype=torch.float32)]
grid_model = TestModule()
self.run_test(grid_model, inputs)
It would be code design choice to either encapsulate it in the lambda function in the parameters, or declare it in the above way. In my opinion both should be good.
You could let me know if you think otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see - this makes sense, thanks. In that case, it seems good to go - should just need a rebase to enable testing.
d6190f9
to
2b53da2
Compare
2b53da2
to
e3fedca
Compare
This PR addresses the issue #2665