Conversation
Collaborator
Author
|
PR #2682 seems to adddress partially the above. |
7 tasks
93f7316 to
d6190f9
Compare
gs-olive
reviewed
Mar 18, 2024
|
|
||
| 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]) |
Contributor
There was a problem hiding this comment.
Would this need to be grid_sampler_aten_ops[op_name](x, grid)?
Collaborator
Author
There was a problem hiding this comment.
@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.
Contributor
There was a problem hiding this comment.
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
peri044
pushed a commit
that referenced
this pull request
Apr 19, 2024
laikhtewari
pushed a commit
that referenced
this pull request
May 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue #2665