MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / cache_input_hook

Function cache_input_hook

quantization/pre_quant.py:144–147  ·  view source on GitHub ↗
(m, x, y, name, feat_dict)

Source from the content-addressed store, hash-verified

142
143 # firstly, get input features of all linear layers
144 def cache_input_hook(m, x, y, name, feat_dict):
145 x = x[0]
146 x = x.detach().cpu()
147 feat_dict[name].append(x)
148
149 input_feat = defaultdict(list)
150 handles = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected