Open
Description
Multiplying a float tensor and a bool tensor on DML produces a bool tensor which is expected to be a float tensor as on CPU.
import torch
import torch_directml
dml = torch_directml.device()
t1cpu = torch.Tensor([0, 1])
t1dml = t1cpu.to(dml)
t2cpu = t1cpu > 0
t2dml = t1dml > 0
t1cpu *= t2cpu
t1dml *= t2dml
print(t1cpu)
print(t1dml)
Output:
tensor([0., 1.])
tensor([False, True], device='privateuseone:0')
Version:
torch 2.4.1
torch-directml 0.2.5.dev240914
Metadata
Metadata
Assignees
Labels
No labels