MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / param_hook

Method param_hook

codegeex/megatron/model/distributed.py:166–171  ·  view source on GitHub ↗
(*unused)

Source from the content-addressed store, hash-verified

164
165 # Hook used for back-prop.
166 def param_hook(*unused):
167 # Add the gradient to the buffer.
168 if param.grad.data is not None:
169 param.main_grad.add_(param.grad.data)
170 # Now we can deallocate grad memory.
171 param.grad = None
172
173 return param_hook
174

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected