code: def test_loss_computation_parity_with_mmf_trainer(self):
      # compute mmf_trainer training losses
      def _on_update_end(report, meter, should_log):
          self.mmf_losses.append(report["losses"]["loss"].item())
  
      config = get_config_with_defaults(
          {"training": {"max_updates": 5, "max_epochs": None}}
      )
      mmf_trainer = get_mmf_trainer(config=config)
      mmf_trainer.on_update_end = _on_update_end
      mmf_trainer.evaluation_loop = MagicMock(return_value=(None, None))
      mmf_trainer.training_loop()
  
      # compute lightning_trainer training losses
      with patch(
          "mmf.trainers.lightning_trainer.get_mmf_env", return_value=""
      ):
          config = get_config_with_defaults(
              {"trainer": {"params": {"max_steps": 5}}}
          )
          trainer = get_lightning_trainer(config=config)
          trainer.callbacks.append(self)
          trainer.trainer.fit(
              trainer.model, trainer.data_module.train_loader
          )
  
file_path: mmf/tests/trainers/lightning/test_loss.py
imports: import unittest
  from unittest.mock import MagicMock, patch
  from mmf.common.report import Report
  from pytorch_lightning.callbacks.base import Callback
  from tests.trainers.test_utils import get_config_with_defaults, get_lightning_trainer, get_mmf_trainer
label_desc: Use image node_id 2 for calling the TestLightningTrainerLoss obj's underlying member method code with example usage: obj.test_loss_computation_parity_with_mmf_trainer() without return types