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:
Alex Şuhan
2019-02-28 13:28:17 -08:00
committed by Facebook Github Bot
parent c596683309
commit e157a6432f
4 changed files with 2 additions and 12 deletions

View File

@ -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
}