(self, value: TfExpression)
return value * tfutil.exp2(-self.get_loss_scaling_var(value.device))
Undo the effect of dynamic loss scaling for the given expression.
Undo the effect of dynamic loss scaling for the given expression.
Undo the effect of dynamic loss scaling for the given expression .
def undo_loss_scaling(self, value: TfExpression) -> TfExpression:
        """Undo the effect of dynamic loss scaling for the given expression."""
        assert tfutil.is_tf_expression(value)
        if not self.use_loss_scaling:
            return value
        return value * tfutil.exp2(-self.get_loss_scaling_var(value.device))
def undo_loss_scaling ( self , value : TfExpression ) -> TfExpression : assert tfutil . is_tf_expression ( value ) if not self . use_loss_scaling : return value return value * tfutil . exp2 ( - self . get_loss_scaling_var ( value . device ) )