class_docstr: 通过该 callback 来测试模型的训练是否基本正常；
class_docstr_tok: ["\u901a\u8fc7\u8be5","callback","\u6765\u6d4b\u8bd5\u6a21\u578b\u7684\u8bad\u7ec3\u662f\u5426\u57fa\u672c\u6b63\u5e38\uff1b"]
code: def on_before_backward(self, trainer, outputs):
      loss = trainer.extract_loss_from_outputs(outputs)
      loss = trainer.driver.tensor_to_numeric(loss)
      self.loss = loss
      if self.loss_begin_value is None:
          self.loss_begin_value = loss
  
imports: from fastNLP.core.callbacks.callback import Callback
label_desc: Use image node_id 2 for calling the RecordLossCallback obj's underlying member method code with example usage: obj.on_before_backward(trainer, outputs) without return types