MCPcopy Create free account
hub / github.com/UX-Decoder/Semantic-SAM / step

Method step

train_net.py:248–251  ·  view source on GitHub ↗
(self, closure=None)

Source from the content-addressed store, hash-verified

246
247 class FullModelGradientClippingOptimizer(optim):
248 def step(self, closure=None):
249 all_params = itertools.chain(*[x["params"] for x in self.param_groups])
250 torch.nn.utils.clip_grad_norm_(all_params, clip_norm_val)
251 super().step(closure=closure)
252
253 return FullModelGradientClippingOptimizer if enable else optim
254

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected