code: def test_mmdet_bbox_models_light_training_step_returns_loss(
      self,
      ds,
      model_type,
      pretrained,
      cfg_options,
      samples_source,
      request,
  ):
      with torch.set_grad_enabled(True):
          train_dl, _, model = self.dls_model(
              ds,
              model_type,
              pretrained,
              cfg_options,
              samples_source,
              request,
          )
  
          class LitModel(model_type.lightning.ModelAdapter):
              def configure_optimizers(self):
                  return Adam(self.parameters(), lr=1e-4)
  
          expected_loss = random.randint(0, 10)
          model.train_step = lambda **args: {
              "log_vars": {},
              "loss": expected_loss,
          }
          light_model = LitModel(model)
          for batch in train_dl:
              batch
              break
  
          loss = light_model.training_step(batch, 0)
  
          assert loss == expected_loss
  
file_path: icevision/tests/models/mmdet/test_model.py
imports: import pytest
  import random
  from icevision.all import *
label_desc: Use image node_id 4 for calling the TestBboxModels obj's underlying member method code with example usage: obj.test_mmdet_bbox_models_light_training_step_returns_loss(ds, model_type, pretrained, cfg_options, samples_source, request) and returns: Adam