code: def test_lightning_yolo_logs_losses_during_test_step(
      fridge_ds, backbone
  ):
      with torch.set_grad_enabled(False):
          _, valid_ds = fridge_ds
          valid_dl = models.ultralytics.yolov5.train_dl(
              valid_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.eval()
          light_model.compute_loss = lambda *args: [
              random.randint(0, 10)
          ]
          for batch in valid_dl:
              batch
              break
  
          light_model.test_step(batch, 0)
  
          assert list(light_model.logs.keys()) == [f"test_loss"]
  
imports: import pytest
  from icevision.all import *
  from icevision.models.ultralytics.yolov5.backbones import *
label_desc: Use image node_id 4 for calling a global function with example usage: test_lightning_yolo_logs_losses_during_test_step(fridge_ds, backbone) and returns: SGD