code: def test_lightining_retinanet_training_step_returns_loss(
      fridge_faster_rcnn_dls, fridge_retinanet_model, light_model_cls
  ):
      with torch.set_grad_enabled(True):
          train_dl, _ = fridge_faster_rcnn_dls
          light_model = light_model_cls(fridge_retinanet_model)
          expected_loss = random.randint(0, 10)
          light_model.compute_loss = lambda *args: expected_loss
          for batch in train_dl:
              break
  
          loss = light_model.training_step(batch, 0)
  
          assert loss == expected_loss
  
imports: import pytest
  from icevision.all import *
  from icevision.models.torchvision import retinanet
label_desc: Use image node_id 3 for calling a global function with example usage: test_lightining_retinanet_training_step_returns_loss(fridge_faster_rcnn_dls, fridge_retinanet_model, light_model_cls) without return types