multimodalart HF Staff commited on
Commit
fd6be91
·
verified ·
1 Parent(s): d8c70a7

Update comfy/float.py

Browse files
Files changed (1) hide show
  1. comfy/float.py +1 -1
comfy/float.py CHANGED
@@ -55,7 +55,7 @@ def stochastic_rounding(value, dtype, seed=0):
55
  if dtype == torch.bfloat16:
56
  return value.to(dtype=torch.bfloat16)
57
  if dtype == torch.float8_e4m3fn or dtype == torch.float8_e5m2:
58
- generator = torch.Generator(device=value.device)
59
  generator.manual_seed(seed)
60
  output = torch.empty_like(value, dtype=dtype)
61
  num_slices = max(1, (value.numel() / (4096 * 4096)))
 
55
  if dtype == torch.bfloat16:
56
  return value.to(dtype=torch.bfloat16)
57
  if dtype == torch.float8_e4m3fn or dtype == torch.float8_e5m2:
58
+ generator = torch.Generator(device='cpu')
59
  generator.manual_seed(seed)
60
  output = torch.empty_like(value, dtype=dtype)
61
  num_slices = max(1, (value.numel() / (4096 * 4096)))