MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / decorator

Function decorator

bitsandbytes/backends/default/ops.py:17–30  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

15 """
16
17 def decorator(fn):
18 try:
19 compiled_fn = torch.compile(fn, **compile_kwargs)
20
21 @wraps(fn)
22 def wrapper(*args, **kwargs):
23 try:
24 return compiled_fn(*args, **kwargs)
25 except Exception:
26 return fn(*args, **kwargs)
27
28 return wrapper
29 except Exception:
30 return fn
31
32 if func is None:
33 return decorator

Callers 1

_try_torch_compileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected