mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Make IValue::unsafeToTensorImpl a little less unsafe. (#88043)
Signed-off-by: Edward Z. Yang <ezyang@fb.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/88043 Approved by: https://github.com/anjali411, https://github.com/albanD
This commit is contained in:
parent
e238752e20
commit
8ea19c802e
|
|
@ -425,6 +425,7 @@ public:
|
||||||
at::Tensor& toTensor() &;
|
at::Tensor& toTensor() &;
|
||||||
const at::Tensor& toTensor() const&;
|
const at::Tensor& toTensor() const&;
|
||||||
at::TensorImpl* unsafeToTensorImpl() const {
|
at::TensorImpl* unsafeToTensorImpl() const {
|
||||||
|
TORCH_INTERNAL_ASSERT(isTensor());
|
||||||
return payload.as_tensor.unsafeGetTensorImpl();
|
return payload.as_tensor.unsafeGetTensorImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user