Conversation
apaszke
left a comment
There was a problem hiding this comment.
Can you please also add the function to tools/autograd/derivatives.yaml and specify that its derivative is stack? This will be much more efficient than what's currently generated by this op. Thanks!
aten/src/ATen/native/TensorShape.cpp
Outdated
| } | ||
|
|
||
| std::vector<Tensor> unbind(const Tensor &self, int64_t dim) { | ||
| AT_CHECK(dim < self.dim(), "dim must be smaller than ", self.dim()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| Arguments: | ||
| tensor (Tensor): the tensor to unbind | ||
| dim (int): dimension to remove | ||
| """) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@apaszke @vishwakftw Done |
| } | ||
|
|
||
| std::vector<Tensor> to_tensor_list(const variable_list& variables) { | ||
| return fmap(variables, [](torch::autograd::Variable v) { return static_cast<Tensor>(v); } ); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| tensors[i] = self.select(dim, i); | ||
| } | ||
| return tensors; | ||
| } |
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.
|
cc @apaszke how does this look now? |
|
@pytorchbot retest this please |
apaszke
left a comment
There was a problem hiding this comment.
LGTM! Can you please add grad tests for unbind (it has its own grad definition now)?
|
Another thing I'm wondering about is if we won't end up paying the cost of creating autograd functions for those nested |
|
@apaszke Isn't the grad test already there? |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@soumith has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Pull Request resolved: pytorch/pytorch#8587 Differential Revision: D8764086 Pulled By: soumith fbshipit-source-id: 7f311cf13c341040e1f2cf4a8f05723e32d38947
Summary: Pull Request resolved: pytorch/pytorch#8587 Differential Revision: D8764086 Pulled By: soumith fbshipit-source-id: 7f311cf13c341040e1f2cf4a8f05723e32d38947
Summary: Pull Request resolved: pytorch#8587 Differential Revision: D8764086 Pulled By: soumith fbshipit-source-id: 7f311cf13c341040e1f2cf4a8f05723e32d38947
No description provided.