MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / _decorator_helper

Function _decorator_helper

PATH/core/fp16/amp.py:18–26  ·  view source on GitHub ↗
(orig_fn, cast_fn, wrap_fn)

Source from the content-addressed store, hash-verified

16_ORIGINAL_MODULE_HALF = None
17
18def _decorator_helper(orig_fn, cast_fn, wrap_fn):
19 def wrapper(*args, **kwargs):
20 handle = _DECORATOR_HANDLE
21 if handle is None or not handle.is_active():
22 return orig_fn(*args, **kwargs)
23 inner_cast_fn = utils.verbosify(cast_fn, orig_fn.__name__,
24 handle.verbose)
25 return wrap_fn(orig_fn, inner_cast_fn, handle)(*args, **kwargs)
26 return wrapper
27
28# Decorator form
29def half_function(fn):

Callers 2

half_functionFunction · 0.85
float_functionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected