mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-24 05:37:53 +08:00
Use stream for casting if enabled. (#7833)
This commit is contained in:
parent
6d1455de3f
commit
520b3c22e3
@ -980,6 +980,9 @@ def cast_to(weight, dtype=None, device=None, non_blocking=False, copy=False, str
|
|||||||
if not copy:
|
if not copy:
|
||||||
if dtype is None or weight.dtype == dtype:
|
if dtype is None or weight.dtype == dtype:
|
||||||
return weight
|
return weight
|
||||||
|
if stream is not None:
|
||||||
|
with stream:
|
||||||
|
return weight.to(dtype=dtype, copy=copy)
|
||||||
return weight.to(dtype=dtype, copy=copy)
|
return weight.to(dtype=dtype, copy=copy)
|
||||||
|
|
||||||
if stream is not None:
|
if stream is not None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user