(self, value: TfExpression)
return value * tfutil.exp2(self.get_loss_scaling_var(value.device))
Apply dynamic loss scaling for the given expression.
Apply dynamic loss scaling for the given expression.
Apply dynamic loss scaling for the given expression .
def apply_loss_scaling(self, value: TfExpression) -> TfExpression:
        """Apply 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 apply_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 ) )