When a tensor is moved / initially placed in the DML device it seems the data pointer can't be read. Instead it throws the error:
RuntimeError: Cannot access data pointer of Tensor that doesn't have storage
Is there a way around this? I'm hoping to use the data pointer to pre-allocate inputs and outputs and use ONNX Runtime's IO Binding API with DirectML.
Basic code snippet to reproduce:
import torch
import torch_directml
dml = torch_directml.device(0)
x = torch.tensor([1, 2]).to(dml)
print(x.data_ptr())
When a tensor is moved / initially placed in the DML device it seems the data pointer can't be read. Instead it throws the error:
RuntimeError: Cannot access data pointer of Tensor that doesn't have storageIs there a way around this? I'm hoping to use the data pointer to pre-allocate inputs and outputs and use ONNX Runtime's IO Binding API with DirectML.
Basic code snippet to reproduce: