1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

enhance value guard of _device_agnostic_dispatch (#11553)

enhance value guard

Signed-off-by: Matrix Yao <matrix.yao@intel.com>
This commit is contained in:
Yao Matrix
2025-05-19 08:35:32 +08:00
committed by GitHub
parent 9836f0e000
commit 1a10fa0c82

View File

@@ -1212,8 +1212,8 @@ def _device_agnostic_dispatch(device: str, dispatch_table: Dict[str, Callable],
# Some device agnostic functions return values. Need to guard against 'None' instead at
# user level
if fn is None:
return None
if not callable(fn):
return fn
return fn(*args, **kwargs)