MCPcopy Create free account
hub / github.com/YeWR/EfficientZero / get_gradients

Method get_gradients

core/model.py:121–126  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

119 self.load_state_dict(weights)
120
121 def get_gradients(self):
122 grads = []
123 for p in self.parameters():
124 grad = None if p.grad is None else p.grad.data.cpu().numpy()
125 grads.append(grad)
126 return grads
127
128 def set_gradients(self, gradients):
129 for g, p in zip(gradients, self.parameters()):

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected