mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix Python device type property for XLA and MSNPU
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17361 Differential Revision: D14243546 Pulled By: soumith fbshipit-source-id: b7498968f72e3d97de5bf6e5b44c5a59b6913acb
This commit is contained in:
committed by
Facebook Github Bot
parent
c596683309
commit
e157a6432f
@ -404,7 +404,7 @@ static PyObject * THPVariable_layout(THPVariable* self) {
|
||||
|
||||
static PyObject * THPVariable_device(THPVariable* self) {
|
||||
HANDLE_TH_ERRORS
|
||||
return THPDevice_New(torch::tensors::getDevice(self->cdata));
|
||||
return THPDevice_New(self->cdata.device());
|
||||
END_HANDLE_TH_ERRORS
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user