Environment
- Platform: Apple Silicon (MPS)
- PyTorch MPS backend
- tinyml-tinyverse r1.4
Bug
tinyml_tinyverse/common/utils/utils.py calls .float() on tensors after .to(device) in multiple training functions. On Apple Silicon (MPS), .float() resolves to float64, which MPS does not support:
Affected lines
All occurrences of the pattern .to(device[, non_blocking=True]).float() in utils.py, e.g.:
# Line ~1452 (and 15 other sites)
data = data_feat_ext.to(device).float() # crashes on MPS
Fix
Replace .float() with .to(torch.float32) — explicit dtype is the PyTorch-recommended pattern for cross-device code:
data = data_feat_ext.to(device).to(torch.float32) # works on MPS, CUDA, CPU
Workaround
Applied locally to the installed package (16 sites in utils.py).
Environment
Bug
tinyml_tinyverse/common/utils/utils.pycalls.float()on tensors after.to(device)in multiple training functions. On Apple Silicon (MPS),.float()resolves to float64, which MPS does not support:Affected lines
All occurrences of the pattern
.to(device[, non_blocking=True]).float()inutils.py, e.g.: