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

Function cache_input_hook

quantization/autoclip.py:169–172  ·  view source on GitHub ↗
(m, x, y, name, feat_dict)

Source from the content-addressed store, hash-verified

167
168 # firstly, get input features of all linear layers
169 def cache_input_hook(m, x, y, name, feat_dict):
170 x = x[0]
171 x = x.detach().cpu()
172 feat_dict[name].append(x)
173
174 input_feat = defaultdict(list)
175 handles = []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected