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

Function register_float_module

PATH/core/fp16/amp.py:50–57  ·  view source on GitHub ↗
(module, cast_args=True)

Source from the content-addressed store, hash-verified

48 _USER_CAST_REGISTRY.add((module, name, utils.maybe_float))
49
50def register_float_module(module, cast_args=True):
51 if not issubclass(module, torch.nn.modules.module.Module):
52 raise ValueError('{} is not a torch Module'.format(module))
53
54 if cast_args:
55 register_float_function(module, 'forward')
56
57 _USER_FLOAT_MODULE.add(module)
58
59class AmpHandle(object):
60 def __init__(self, enable_caching=True, verbose=False):

Callers

nothing calls this directly

Calls 1

register_float_functionFunction · 0.85

Tested by

no test coverage detected