MCPcopy
hub / github.com/deepspeedai/DeepSpeed / step

Method step

tests/unit/simple_model.py:209–221  ·  view source on GitHub ↗
(self, closure=None)

Source from the content-addressed store, hash-verified

207 super(SimpleOptimizer, self).__setstate__(state)
208
209 def step(self, closure=None):
210 loss = None
211 if closure is not None:
212 loss = closure()
213
214 for group in self.param_groups:
215 for p in group['params']:
216 if p.grad is None:
217 continue
218 d_p = p.grad.data
219 p.data.add_(-group['lr'], d_p)
220
221 return loss
222
223
224class HybridStateOptimizer(torch.optim.Optimizer):

Callers 7

test_compile.pyFile · 0.45
_test_perfFunction · 0.45
adam_test1.pyFile · 0.45
_test_perfFunction · 0.45
test_model.pyFile · 0.45

Calls

no outgoing calls

Tested by 2

_test_perfFunction · 0.36
_test_perfFunction · 0.36