Register layout for XLA backend.
authorDavide Libenzi <dlibenzi@google.com>
Tue, 12 Feb 2019 21:34:11 +0000 (13:34 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 12 Feb 2019 21:44:07 +0000 (13:44 -0800)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16946

Differential Revision: D14054716

Pulled By: gchanan

fbshipit-source-id: 063495b99b9f7d29ca3ad2020a6bc90d36ba0d7d

torch/csrc/utils/tensor_layouts.cpp

index 7d984f5..4b1b36f 100644 (file)
@@ -24,6 +24,7 @@ void initializeLayouts() {
   registerLayoutObject((THPLayout*)strided_layout, at::Backend::CPU);
   registerLayoutObject((THPLayout*)strided_layout, at::Backend::CUDA);
   registerLayoutObject((THPLayout*)strided_layout, at::Backend::MSNPU);
+  registerLayoutObject((THPLayout*)strided_layout, at::Backend::XLA);
 
   PyObject *sparse_coo_layout = THPLayout_New(at::Layout::Sparse, "torch.sparse_coo");
   Py_INCREF(sparse_coo_layout);