-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[jit][script] Support some basic list operations #10225
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
facebook-github-bot
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.
michaelsuo has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| c = a + b | ||
| return c == [1, 2, 3] | ||
|
|
||
| self.checkScript(test_list_add_empty, (), optimize=True) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
torch/csrc/jit/register_prim_ops.cpp
Outdated
| for (size_t i = 0; i < a->elements().size(); ++i) { | ||
| const auto& a_element = a->elements()[i]; | ||
| const auto& b_element = b->elements()[i]; | ||
| if (!a_element.equal(b_element)) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zdevito
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.
These look good!
facebook-github-bot
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.
michaelsuo is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| ->asValue(loc, method); | ||
|
|
||
| } else { | ||
| // if it's a single tensor, map tensor[idx] -> tensor.select(0, idx) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Summary: Support a few basic operators: - eq - add - len - select (indexing) Pull Request resolved: pytorch#10225 Differential Revision: D9172338 Pulled By: michaelsuo fbshipit-source-id: 6e75ec1453b9589b0fb4698598ecdba5a5fccff9
Support a few basic operators: