OpInfo for *_like functions#65941
Conversation
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slowFor more information, please take a look at the CI Flow Wiki. |
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit b12cb40 (more details on the Dr. CI page):
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
|
NB: I will fix the lint whenever fb comes back up... |
pmeier
left a comment
There was a problem hiding this comment.
Some comments inline. Otherwise LGTM when CI is green.
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests [ghstack-poisoned]
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests [ghstack-poisoned]
| 'Tensor.int', | ||
| 'Tensor.long', | ||
| 'Tensor.short', | ||
| 'empty_like', |
There was a problem hiding this comment.
Meta reviewer note: We should make these tests skippable like other tests instead of using custom lists.
cc @Chillee
| return tuple(samples) | ||
|
|
||
| def sample_inputs_like_fns(self, device, dtype, requires_grad, **kwargs): | ||
| inputs: List[Tuple[Tuple, Dict]] = [ |
There was a problem hiding this comment.
Meta note: typing is lame -- did something complain this wasn't done? If so we should fix that so typing is never required in this file.
There was a problem hiding this comment.
Yes, mypy complains when this annotation is removed
There was a problem hiding this comment.
Would you exclude this file from mypy's purview, then?
There was a problem hiding this comment.
@mruberry how sure are we that we should hide this file from mypy? I think typing is generally useful, but I agree that it "gets in the way" while writing OpInfos, like in this case
There was a problem hiding this comment.
If we don't want to go for the nuclear option, just slap a # type: ignore directive on the line.
There was a problem hiding this comment.
The test files are supposed to get an exception from mypy
|
|
||
| return tuple(samples) | ||
|
|
||
| def sample_inputs_full_like(self, *args, **kwargs): |
| OpInfo('randn_like', | ||
| dtypes=floating_types_and(torch.half, torch.bfloat16, torch.complex64, torch.complex128), | ||
| op=lambda inp, *args, **kwargs: | ||
| wrapper_set_seed(torch.randn_like, inp, *args, **kwargs), |
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests [ghstack-poisoned]
|
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests Differential Revision: [D31452625](https://our.internmc.facebook.com/intern/diff/D31452625) [ghstack-poisoned]
|
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests Differential Revision: [D31452625](https://our.internmc.facebook.com/intern/diff/D31452625) [ghstack-poisoned]
|
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests Differential Revision: [D31452625](https://our.internmc.facebook.com/intern/diff/D31452625) [ghstack-poisoned]
|
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests Differential Revision: [D31452625](https://our.internmc.facebook.com/intern/diff/D31452625) [ghstack-poisoned]
|
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests Differential Revision: [D31452625](https://our.internmc.facebook.com/intern/diff/D31452625) [ghstack-poisoned]
|
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests Differential Revision: [D31452625](https://our.internmc.facebook.com/intern/diff/D31452625) [ghstack-poisoned]
|
@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Pull Request resolved: #65941 OpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like Test Plan: - run tests Reviewed By: dagitses Differential Revision: D31452625 Pulled By: zou3519 fbshipit-source-id: 5e6c45918694853f9252488d62bb7f4ccfa1f1e4
Stack from ghstack:
*_likefunctions #65941 OpInfo for*_likefunctionsOpInfos for: empty_like, zeros_like, ones_like, full_like, randn_like
Test Plan:
Differential Revision: D31452625