(self, impl: callable)
return _
We override this func to attach weight clipping after default training step
We override this func to attach weight clipping after default training step
We override this func to attach weight clipping after default training step
def _reset_jit_graph(self, impl: callable):
        """We override this func to attach weight clipping after default training step"""
        traced_obj = jit.trace(impl)
        def _(*args, **kwargs):
            ret = traced_obj(*args, **kwargs)
            if self.training:
                self._apply_lipshitz_constraint()  # dynamically apply weight clipping
            return ret
        return _
def _reset_jit_graph ( self , impl : callable ) : traced_obj = jit . trace ( impl ) def _ ( * args , * * kwargs ) : ret = traced_obj ( * args , * * kwargs ) if self . training : self . _apply_lipshitz_constraint ( ) # dynamically apply weight clipping return ret return _