If we use cuda as pytorch device, we can use
torch.set_default_tensor_type(‘torch.cuda.FloatTensor’)
to set default tensor device as cuda when we create a tensor.
but what should I do if I want to create a tensor with default device as HPU?
If we use cuda as pytorch device, we can use
torch.set_default_tensor_type(‘torch.cuda.FloatTensor’)
to set default tensor device as cuda when we create a tensor.
but what should I do if I want to create a tensor with default device as HPU?
Thanks for posting, will check and get back to you
You can create tensors on device by:
x = torch.tensor([1.0,2.0], device='hpu')
or move them to device by:
x = torch.tensor([1.0,2.0])
x = x.to('hpu')
However you cannot set a default.