Skip to content

Conversation

IvanYashchuk
Copy link
Collaborator

New ref: torch._refs.sum_to_size.

View consistency validation is disabled because the ref returns a view instead of returning the input.

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 20, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/85338

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 4b634c8:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.


def _is_expandable_to(shape, desired):
# Python implementation of
# aten/src/ATen/ExpandUtils.h:is_expandable_to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's still comment here on what the function does

return samples


def error_inputs_sum_to_size(op_info, device, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice error input extension


def sum_to_size(
a: Tensor,
*shape,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the correct type annotation here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't been type annotating the *shape so you needn't bother

@IvanYashchuk
Copy link
Collaborator Author

I fixed the problem with "is_expandable_to" and added error sample input to verify that the implementation is correct now.

@mruberry this is ready for another round.

@mruberry mruberry self-requested a review September 21, 2022 17:28
Copy link
Collaborator

@mruberry mruberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@IvanYashchuk
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here.
The merge job was triggered with the green (-g) flag. This means that your change will be merged once all checks on your PR have passed (ETA: 0-4 Hours). If this is not the intended behavior, feel free to use some of the other merge options in the wiki.
Please reach out to the PyTorch DevX Team with feedback or questions!

@github-actions
Copy link
Contributor

Hey @IvanYashchuk.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@IvanYashchuk IvanYashchuk deleted the refs-sum-to-size branch September 22, 2022 07:26
mehtanirav pushed a commit that referenced this pull request Oct 4, 2022
New ref: `torch._refs.sum_to_size`.

View consistency validation is disabled because the ref returns a view instead of returning the input.
Pull Request resolved: #85338
Approved by: https://github.com/mruberry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants