-
Notifications
You must be signed in to change notification settings - Fork 561
Make inplace operations and view cooperate with each other. #157
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
f609cc2 to
6918efa
Compare
|
Hold on on this one. I am waiting that you do the C++ test restructuring to add tests. |
asuhan
left a comment
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, but it needs tests.
- Basic functionality:
v = x.view(...), thenx.add_(b)andv = x.view(...), thenv.add_(b). In both casesxshould be updated. - View-of-view cases.
- Some more complex expressions involving view would be reassuring.
torch_xla/csrc/tensor.cpp
Outdated
| return id_generator->fetch_add(1); | ||
| } | ||
|
|
||
| std::pair<ir::NodePtr, bool> XLATensor::GetViewIrNode(View* view) { |
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.
I would use a structure here instead of a pair.
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.
Makes sense.
|
It's not much restructuring at all, you should be able to rebase just fine. But I'm sending the PR right now. |
1cec8cf to
d42a3f3
Compare
|
Test added. Will add more complex tests later on. |
asuhan
left a comment
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.
Do you mind adding a Python version of the tests as well?
|
Why should we add the Python versions? |
|
We don't have to, we can move forward with just C++ tests. But we have to decide what should go in the Python tests then and how to deal with the debug mode not working for the C++ tests. |
No description provided.