[jit][script] Support some basic list operations#10225
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
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.
facebook-github-bot
left a comment
There was a problem hiding this comment.
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: