diff options
author | Will Feng <willfeng@fb.com> | 2019-04-11 13:32:45 -0700 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-04-11 14:03:33 -0700 |
commit | c7b5a8a8769f77bc7262acd3ea46c0bc3f693eef (patch) | |
tree | 5bdbc59d042c94dd3b5001303d77448b024e3ff3 /caffe2 | |
parent | ef406ee925b0cca35d227f458eab9af0b927d6ac (diff) | |
download | pytorch-c7b5a8a8769f77bc7262acd3ea46c0bc3f693eef.tar.gz pytorch-c7b5a8a8769f77bc7262acd3ea46c0bc3f693eef.tar.bz2 pytorch-c7b5a8a8769f77bc7262acd3ea46c0bc3f693eef.zip |
Change is_variable() to check existence of AutogradMeta, and remove is_variable_ (#19139)
Summary:
Currently, a TensorImpl's `is_variable_` is true if and only if the TensorImpl has AutogradMeta. This PR unifies these two concepts by removing `is_variable_` and change `is_variable()` to check existence of AutogradMeta instead.
Removing `is_variable_` is part of the work in Variable/Tensor merge.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19139
Differential Revision: D14893339
Pulled By: yf225
fbshipit-source-id: ceb5e22c3c01f79b5d21d5bdbf4a7d1bc397796a
Diffstat (limited to 'caffe2')
-rw-r--r-- | caffe2/core/tensor.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/caffe2/core/tensor.h b/caffe2/core/tensor.h index 3fe7329c84..a0ceec5622 100644 --- a/caffe2/core/tensor.h +++ b/caffe2/core/tensor.h @@ -72,8 +72,7 @@ class CAFFE2_API Tensor final { explicit Tensor(at::Device device) : impl_(c10::make_intrusive<TensorImpl, UndefinedTensorImpl>( Storage::create_legacy(device, TypeMeta()), - c10::computeTensorTypeId(at::device(device).layout(at::kStrided)), - /*is_variable=*/ false + c10::computeTensorTypeId(at::device(device).layout(at::kStrided)) )) { } |