Delete TensorImpl::GetDevice() (#20025)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20025

Delete TensorImpl::GetDevice() and clean all its call sites.

Reviewed By: ezyang

Differential Revision: D15170917

fbshipit-source-id: b6862b74aa036198544f79d18a8c0f995cb0ca7b
This commit is contained in:
Yanbo Liang
2019-05-06 12:10:56 -07:00
committed by Facebook Github Bot
parent 9005a2c0fc
commit a8387b7779
2 changed files with 1 additions and 10 deletions

View File

@ -971,15 +971,6 @@ struct C10_API TensorImpl : public c10::intrusive_ptr_target {
return (*device_opt_).type();
}
/**
* The device of a Tensor; e.g., Device(kCUDA, 1) (the 1-index CUDA
* device).
*/
Device GetDevice() const {
// See NOTE [c10::optional operator usage in CUDA]
return *device_opt_;
}
/**
* @brief Extends the outer-most dimension of this tensor by num elements,
* preserving the existing data.

View File

@ -172,7 +172,7 @@ class CAFFE2_API Tensor final {
}
at::Device GetDevice() const {
return impl_.get()->GetDevice();
return impl_.get()->device();
}
/**