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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user