Adapt to PyTorch explicitly representing optionality#2698
Closed
smessmer wants to merge 1 commit intopytorch:masterfrom
Closed
Adapt to PyTorch explicitly representing optionality#2698smessmer wants to merge 1 commit intopytorch:masterfrom
smessmer wants to merge 1 commit intopytorch:masterfrom
Conversation
c672e6b to
683bbdc
Compare
JackCaoG
requested changes
Dec 28, 2020
torch_xla/csrc/ops/index_ops.cpp
Outdated
Comment on lines
+243
to
+248
| auto indices_vec = at::expand_outplace(ExpandByteTensors(base, orig_indices)); | ||
| torch::List<c10::optional<at::Tensor>> indices; | ||
| indices.reserve(indices_vec.size()); | ||
| for (at::Tensor i : std::move(indices_vec)) { | ||
| indices.push_back(std::move(i)); | ||
| } |
Collaborator
There was a problem hiding this comment.
Why couldn't we just pass indices_vec? I didn;t find the function prototype change of expand_outplace in the linked pytorch pr nor can I find the expand_outplace that takes c10::List<c10::optional<at::Tensor>>& in https://github.com/pytorch/pytorch/blob/71ca600af93b4ad58ca6fc083fa5d42a56b43194/aten/src/ATen/ExpandUtils.h. What am I missing here?
Collaborator
Author
There was a problem hiding this comment.
you're right, I changed it
20ce88a to
b586262
Compare
Collaborator
Author
|
merged in 3aebd8a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyTorch now explicitly represents optionality of Tensors in operator functions. This changes the signature for the indexing operators since they take lists of optional tensors.