-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Implement reshape_as #9452
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
Implement reshape_as #9452
Conversation
1. Added tests 2. Added doc string 3. Remove view_as redundant definition from tensor.py
torch/_tensor_docs.py
Outdated
reshape_as(other) -> Tensor | ||
|
||
Returns this tensor as the same shape as :attr:`other`. | ||
``self.reshape_as(other)`` is equivalent to ``self.reshape(other.shape)``. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
r""" | ||
view_as(other) -> Tensor | ||
|
||
View this tensor as the same size as :attr:`other`. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Looks great in general! |
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.
@ssnl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Thanks @vishwakftw ! |
8e0be12
to
50210ba
Compare
CI failures look fake |
Summary: 1. Added tests 2. Added doc string 3. Remove view_as redundant definition from tensor.py Closes #9416 Pull Request resolved: pytorch/pytorch#9452 Differential Revision: D8851794 Pulled By: ezyang fbshipit-source-id: 0aa0430dd0a174e1a5caddbc50a7e2c9eb7802bc
Summary: 1. Added tests 2. Added doc string 3. Remove view_as redundant definition from tensor.py Closes pytorch#9416 Pull Request resolved: pytorch#9452 Differential Revision: D8851794 Pulled By: ezyang fbshipit-source-id: 0aa0430dd0a174e1a5caddbc50a7e2c9eb7802bc
Summary: 1. Added tests 2. Added doc string 3. Remove view_as redundant definition from tensor.py Closes pytorch#9416 Pull Request resolved: pytorch#9452 Differential Revision: D8851794 Pulled By: ezyang fbshipit-source-id: 0aa0430dd0a174e1a5caddbc50a7e2c9eb7802bc
Summary: 1. Added tests 2. Added doc string 3. Remove view_as redundant definition from tensor.py Closes pytorch#9416 Pull Request resolved: pytorch#9452 Differential Revision: D8851794 Pulled By: ezyang fbshipit-source-id: 0aa0430dd0a174e1a5caddbc50a7e2c9eb7802bc
Closes #9416