MCPcopy Create free account
hub / github.com/modelscope/modelscope / wrapper

Function wrapper

modelscope/utils/import_utils.py:391–395  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

389 # Chose a different decorator name than in tests so it's clear they are not the same.
390 @functools.wraps(func)
391 def wrapper(*args, **kwargs):
392 if is_torch_available():
393 return func(*args, **kwargs)
394 else:
395 raise ImportError(f'Method `{func.__name__}` requires PyTorch.')
396
397 return wrapper
398

Callers

nothing calls this directly

Calls 3

is_torch_availableFunction · 0.85
funcFunction · 0.85
is_tf_availableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…