MCPcopy Index your code
hub / github.com/InternLM/InternLM / zero_grad

Method zero_grad

internlm/core/engine.py:101–103  ·  view source on GitHub ↗

Sets the gradient of all parameters in the model to zero.

(self)

Source from the content-addressed store, hash-verified

99 handler.handle_gradient()
100
101 def zero_grad(self):
102 """Sets the gradient of all parameters in the model to zero."""
103 self.optimizer.zero_grad()
104
105 def step(self):
106 """

Callers 3

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected