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

Function should_cache

PATH/core/fp16/utils.py:71–79  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

69 return isinstance(x, tuple) or isinstance(x, list)
70
71def should_cache(x):
72 if is_nested(x):
73 # Fast-fail version of all(should_cache)
74 for y in x:
75 if not should_cache(y):
76 return False
77 return True
78 return isinstance(x, torch.nn.parameter.Parameter) and \
79 type_string(x) == 'FloatTensor'
80
81def collect_fp_tensor_types(args, kwargs):
82 def collect_types(x, types):

Callers

nothing calls this directly

Calls 2

is_nestedFunction · 0.85
type_stringFunction · 0.85

Tested by

no test coverage detected