From c7b5a8a8769f77bc7262acd3ea46c0bc3f693eef Mon Sep 17 00:00:00 2001 From: Will Feng Date: Thu, 11 Apr 2019 13:32:45 -0700 Subject: 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 --- caffe2/core/tensor.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'caffe2') 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( Storage::create_legacy(device, TypeMeta()), - c10::computeTensorTypeId(at::device(device).layout(at::kStrided)), - /*is_variable=*/ false + c10::computeTensorTypeId(at::device(device).layout(at::kStrided)) )) { } -- cgit v1.2.3