MCPcopy Create free account
hub / github.com/boyiwei/alignment-attribution-code / forward

Method forward

lib/prune.py:115–123  ·  view source on GitHub ↗
(self, inp, **kwargs)

Source from the content-addressed store, hash-verified

113 self.module = module
114
115 def forward(self, inp, **kwargs):
116 inps.append(inp)
117 attention_mask.append(kwargs["attention_mask"])
118 position_ids.append(kwargs["position_ids"])
119 # inps[cache['i']] = inp
120 # cache['i'] += 1
121 # cache['attention_mask'] = kwargs['attention_mask']
122 # cache['position_ids'] = kwargs['position_ids']
123 raise ValueError
124
125 layers[0] = Catcher(layers[0])
126 for batch in dataloader:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected