MCPcopy Create free account
hub / github.com/apple/ml-pointersect / zero_grad

Method zero_grad

cdslib/core/optim/tf_optim.py:115–117  ·  view source on GitHub ↗

Zero the gradient buffer.

(self, set_to_none: bool = False)

Source from the content-addressed store, hash-verified

113 self._step = init_step
114
115 def zero_grad(self, set_to_none: bool = False):
116 """Zero the gradient buffer."""
117 self.optimizer.zero_grad(set_to_none=set_to_none)
118
119 def step(self, scaler=None):
120 """Update parameters and learning rate."""

Callers 3

_testMethod · 0.95
_stepMethod · 0.80
_stepMethod · 0.80

Calls

no outgoing calls

Tested by 2

_testMethod · 0.76
_stepMethod · 0.64