Delete redefinitions of methods in Variable already present on Tensor.#29667
Delete redefinitions of methods in Variable already present on Tensor.#29667ezyang wants to merge 6 commits intogh/ezyang/532/basefrom
Conversation
Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
…t on Tensor." Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
…t on Tensor." Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This also replaces `current_version` with just `_version`. This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> ghstack-source-id: 230faf9 Pull Request resolved: #29667
…t on Tensor." Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This also replaces `current_version` with just `_version`. This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> ghstack-source-id: dd2af2f Pull Request resolved: #29667
CircleCI build failures summaryAs of commit 21ad803:
Here are the reasons each build failed:
This comment was automatically generated by Dr. CI. Please report bugs/suggestions on the GitHub issue tracker. |
| - func: backward(Tensor self, Tensor? gradient=None, bool keep_graph=False, bool create_graph=False) -> () | ||
| variants: method | ||
|
|
||
| # Sets the tensor data held by this `Variable` to be the same as `new_data`. |
There was a problem hiding this comment.
I think we should deprecate this in C++ (i.e., only in documentation).
You can say use something like NoGrad and in-place functions instead.
There was a problem hiding this comment.
Well, in Python I can say x.data = ... and to the best of my knowledge we haven't deprecated that yet. Are you suggesting we deprecate this too?
There was a problem hiding this comment.
YES ! Please !
(note that might require update to some of our optimizers)
| supports_named_tensor: True | ||
|
|
||
| # Returns a copy of this `Variable` that is detached from its autograd graph | ||
| # and has a blank version. This method is OK to call if the `Variable` is a |
There was a problem hiding this comment.
this isn't correct, I think you are confusing detach and .data (in python).
E.g.:
>>> torch.randn(2,3).add_(1).add_(2).detach()._version
2
>>> torch.randn(2,3).add_(1).add_(2).data._version
0
There was a problem hiding this comment.
BTW, I plead "pre-existing" code ;) (I'll fix)
…t on Tensor." Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This also replaces `current_version` with just `_version`. This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> ghstack-source-id: 74d7575 Pull Request resolved: #29667
|
|
||
| # Returns the input index of the gradient `Node` to which this | ||
| # `Variable` is connected. Note: input indexes of the gradient `Node` | ||
| # correspond to output indexes of the corresponding forward `Node`. |
There was a problem hiding this comment.
"forward None" is not really a thing :/
Maybe just "forward function" here?
There was a problem hiding this comment.
I plead preexisting comments XD (ok will fix)
| supports_named_tensor: True | ||
| variants: function, method | ||
|
|
||
| # Like `detach()`, but removes this `Variable` in-place. This method may |
…t on Tensor." Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This also replaces `current_version` with just `_version`. This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Differential Revision: [D18504934](https://our.internmc.facebook.com/intern/diff/D18504934) [ghstack-poisoned]
…. (#29667) Summary: Pull Request resolved: pytorch/pytorch#29667 Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This also replaces `current_version` with just `_version`. This is a carved out portion of #28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Differential Revision: D18504934 Pulled By: ezyang fbshipit-source-id: be7adf45b637daffe2b0b1631eb31d967525fc31
Some previous implementations are defined in native_functions.yaml. In this case, I don't define them explicitly in Tensor; instead they are placed in VariableTypeManual.cpp. When I did this, I would have deleted documentation; instead, this documentation was moved to native_functions.yaml This is a carved out portion of pytorch#28287, rebased past Tensor-Variable merge. Signed-off-by: Edward Z. Yang <ezyang@fb.com> ghstack-source-id: 0d2141e Pull Request resolved: pytorch#29667
Stack from ghstack:
Some previous implementations are defined in native_functions.yaml.
In this case, I don't define them explicitly in Tensor; instead
they are placed in VariableTypeManual.cpp. When I did this, I would
have deleted documentation; instead, this documentation was moved
to native_functions.yaml
This also replaces
current_versionwith just_version.This is a carved out portion of #28287, rebased past Tensor-Variable
merge.
Signed-off-by: Edward Z. Yang ezyang@fb.com
Differential Revision: D18504934