ankane / torch.rb

Deep learning for Ruby, powered by LibTorch
Other
704 stars 30 forks source link

Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead #50

Closed chenillen closed 6 months ago

chenillen commented 6 months ago
require 'torch'
x = Torch.rand(3, 2, dtype: :float32, device: 'mps')
=> Error inspecting tensor: #<RuntimeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.>

The tensor generated datatype is actually float32, but then switch device to 'mps', the error occurs.

ankane commented 6 months ago

Hi @chenillen, thanks for reporting! Fixed in the commit above.