code: def test_lightning_yolo_logs_losses_during_training_step(
      fridge_ds, backbone
  ):
      with torch.set_grad_enabled(True):
          train_ds, _ = fridge_ds
          train_dl = models.ultralytics.yolov5.train_dl(
              train_ds, batch_size=1, num_workers=0, shuffle=False
          )
          model = models.ultralytics.yolov5.model(
              num_classes=5,
              img_size=384,
              backbone=backbone(pretrained=False),
          )
  
          class LightModel(
              models.ultralytics.yolov5.lightning.ModelAdapter
          ):
              def __init__(self, model, metrics=None):
                  super(LightModel, self).__init__(model, metrics)
                  self.model = model
                  self.logs = {}
  
              def configure_optimizers(self):
                  return SGD(self.parameters(), lr=1e-4)
  
              def log(self, key, value, **args):
                  super(LightModel, self).log(key, value, **args)
                  self.logs[key] = value
  
          light_model = LightModel(model)
          light_model.to("cpu")
          light_model.compute_loss = lambda *args: [
              random.randint(0, 10)
          ]
          for batch in train_dl:
              batch
              break
  
          light_model.training_step(batch, 0)
  
          assert list(light_model.logs.keys()) == [f"train_loss"]
  
imports: import pytest
  from icevision.all import *
  from icevision.models.ultralytics.yolov5.backbones import *
label_desc: Use image node_id 3 for calling a global function with example usage: test_lightning_yolo_logs_losses_during_training_step(fridge_ds, backbone) and returns: SGD