MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / step

Method step

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

Source from the content-addressed store, hash-verified

196 super(SimpleOptimizer, self).__setstate__(state)
197
198 def step(self, closure=None):
199 loss = None
200 if closure is not None:
201 loss = closure()
202
203 for group in self.param_groups:
204 for p in group['params']:
205 if p.grad is None:
206 continue
207 d_p = p.grad.data
208 p.data.add_(-group['lr'], d_p)
209
210 return loss
211
212
213class HybridStateOptimizer(torch.optim.Optimizer):

Callers 9

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

Calls

no outgoing calls

Tested by 3

mainFunction · 0.36
_test_perfFunction · 0.36
_test_perfFunction · 0.36