code: def on_train_begin(self, **kwargs):
          "check if loss is reduction"
          if hasattr(self.loss_func, "reduction") and (self.loss_func.reduction != "sum"):
               warn("For better gradients consider 'reduction=sum'"f on_train_begin(self, **kwargs):
          "check if loss is reduction"
          if hasattr(self.loss_func, "reduction") and (self.loss_func.reduction != "sum"):
               warn("For better gradients consider 'reduction=sum'")
docs: check if loss is reduction