mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
Facebook Github Bot
parent
9005a2c0fc
commit
a8387b7779
@ -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.
|
||||
|
@ -172,7 +172,7 @@ class CAFFE2_API Tensor final {
|
||||
}
|
||||
|
||||
at::Device GetDevice() const {
|
||||
return impl_.get()->GetDevice();
|
||||
return impl_.get()->device();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user