Skip to content

Commit 39f114c

Browse files
Less broken non blocking?
1 parent 6730f3e commit 39f114c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

comfy/ops.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121

2222

2323
def cast_to(weight, dtype=None, device=None, non_blocking=False):
24-
non_blocking = False
25-
return weight.to(device=device, dtype=dtype, non_blocking=non_blocking)
24+
r = torch.empty_like(weight, dtype=dtype, device=device)
25+
r.copy_(weight, non_blocking=non_blocking)
26+
return r
2627

2728
def cast_to_input(weight, input, non_blocking=False):
2829
return cast_to(weight, input.dtype, input.device, non_blocking=non_blocking)

0 commit comments

Comments
 (0)