Move version_counter_ to TensorImpl (#18223)
authorWill Feng <willfeng@fb.com>
Thu, 11 Apr 2019 22:09:35 +0000 (15:09 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 11 Apr 2019 22:12:45 +0000 (15:12 -0700)
commit4ae59e47440429fdec40d728facfc8fb3730c16e
tree5df0468a71b4e0c2a49fd465819ab2a2b00278f4
parent507fe66beaad18b30eda8c0de77afd075c55e602
Move version_counter_ to TensorImpl (#18223)

Summary:
According to https://github.com/pytorch/pytorch/issues/13638#issuecomment-468055428, after the Variable/Tensor merge, we may capture variables without autograd metadata inside an autograd function, and we need a working version counter in these cases. This PR makes it possible by moving `version_counter_` out of autograd metadata and into TensorImpl, so that variables without autograd metadata still have version counters.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18223

Differential Revision: D14735123

Pulled By: yf225

fbshipit-source-id: 15f690311393ffd5a53522a226da82f5abb6c65b
aten/src/ATen/OpaqueTensorImpl.h
aten/src/ATen/SparseTensorImpl.h
c10/core/TensorImpl.h
torch/csrc/autograd/saved_variable.h
torch/csrc/autograd/variable.cpp
torch/csrc/autograd/variable.h
torch/csrc/autograd/variable_version.h [deleted file]