code: def add_model(trainer, model):
      model.build()
      model.train()
      model.to(trainer.device)
      trainer.model = model
  
file_path: mmf/tests/trainers/test_utils.py
imports: import os
  import torch
  from mmf.utils.build import build_optimizer
  from mmf.utils.configuration import load_yaml
  from omegaconf import OmegaConf
  from tests.test_utils import SimpleLightningModel, SimpleModel
  from tests.trainers.lightning.lightning_trainer_mock import LightningTrainerMock
  from tests.trainers.test_trainer_mocks import TrainerTrainingLoopMock
label_desc: Use image node_id 3 for calling a global function with example usage: add_model(trainer, model) without return types