-
Notifications
You must be signed in to change notification settings - Fork 327
Closed as not planned
Labels
pytorch-directmlIssues in PyTorch when using its DirectML backendIssues in PyTorch when using its DirectML backend
Description
PyTorch does not allow to copy data from meta device.

But DirectML device allows it.
Python 3.10.11 | packaged by Anaconda, Inc. | (main, Apr 20 2023, 18:56:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch, torch_directml
>>> device = torch_directml.device()
>>> ten = torch.randn(4, dtype=torch.float32)
>>> ten
tensor([ 0.9687, 0.3756, 2.0894, -0.4535])
>>> ten.to("meta")
tensor(..., device='meta', size=(4,))
>>> ten.to("meta").to("cpu")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: Cannot copy out of meta tensor; no data!
>>> ten.to("meta").to(device)
tensor([0., 0., 0., 0.], device='privateuseone:0') # <-- this behavior does not make sense.Metadata
Metadata
Assignees
Labels
pytorch-directmlIssues in PyTorch when using its DirectML backendIssues in PyTorch when using its DirectML backend