-
Notifications
You must be signed in to change notification settings - Fork 25.2k
OpInfo: div - port pending method_tests entry #59173
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
Conversation
💊 CI failures summary and remediationsAs of commit 318b8b3 (more details on the Dr. CI page):
1 failure not recognized by patterns:
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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.
This looks pretty good @kshitij12345; I made a few comments inline for your review. Looking forward to porting one of the largest remaining set of method_tests()!
@mruberry Addressed the reviews. PTAL :) Changes
|
@@ -739,7 +732,10 @@ def sample_inputs_linalg_vector_norm(op_info, device, dtype, requires_grad, **kw | |||
# specify scalars of floating, integral & complex types as values for "alpha". | |||
# Keyword argument `rhs_exclude_zero` is used to exclude zero values from rhs tensor argument | |||
# This is necessary for operations like `true_divide`, where divide by zero throws an exception. | |||
def sample_inputs_binary_pwise(op_info, device, dtype, requires_grad, **kwargs): | |||
def sample_inputs_binary_pwise(op_info, device, dtype, requires_grad, extra_kwargs=None, **kwargs): |
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.
extra_kwargs
is a better name
Style nit (only to be fixed if significant changes are required): make extra_kwargs
keyword-only?
@@ -1263,20 +1261,6 @@ def sample_inputs_comparison_ops(self, device, dtype, requires_grad, **kwargs): | |||
sample_inputs = [*sample_inputs, *more_inputs] | |||
return tuple(sample_inputs) | |||
|
|||
def sample_inputs_div(self, device, dtype, requires_grad, rounding_mode=None, **kwargs): |
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.
Nice simplification
sample_inputs_func=sample_inputs_div, | ||
skips=(SkipInfo('TestOpInfo', 'test_duplicate_method_tests'),), | ||
assert_autodiffed=True), | ||
OpInfo('div', |
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.
Nice job noticing this was redundant
@@ -6864,24 +6849,6 @@ def ident(x): | |||
def method_tests(): | |||
set_rng_seed(SEED) | |||
return [ | |||
('div', (S, S, S), (torch.rand(S, S, S) + 0.1,), '', (True,)), |
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.
Wahoo!
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.
Awesome work, @kshitij12345!
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Reference: pytorch#54261 Depends on: pytorch#59154 Pull Request resolved: pytorch#59173 Reviewed By: ngimel Differential Revision: D28785178 Pulled By: mruberry fbshipit-source-id: 902310f2d77e499a2355a23b2d5a8c0b21b8c5bb
Reference: #54261
Depends on: #59154