MCPcopy Create free account
hub / github.com/microsoft/TRELLIS / zero_grad

Function zero_grad

trellis/trainers/utils.py:55–62  ·  view source on GitHub ↗
(model_params)

Source from the content-addressed store, hash-verified

53
54
55def zero_grad(model_params):
56 for param in model_params:
57 if param.grad is not None:
58 if param.grad.grad_fn is not None:
59 param.grad.detach_()
60 else:
61 param.grad.requires_grad_(False)
62 param.grad.zero_()
63
64
65# LR Schedulers

Callers 1

run_stepMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected