code: def __init__(
      self,
      num_train_data,
      max_updates,
      max_epochs,
      device="cuda",
      fp16_model=False,
  ):
      config = get_config_with_defaults(
          {
              "training": {
                  "max_updates": max_updates,
                  "max_epochs": max_epochs,
                  "evaluation_interval": 10000,
                  "fp16": True,
              },
              "run_type": "train",
          }
      )
      super().__init__(num_train_data, config=config)
      if fp16_model:
          assert (
              torch.cuda.is_available()
          ), "MMFTrainerMock fp16 requires cuda enabled"
          model = SimpleModelWithFp16Assert({"in_dim": 1})
          model.build()
          model = model.cuda()
      else:
          model = SimpleModel({"in_dim": 1})
          model.build()
          model.train()
          model.to(self.device)
  
      self.model = model
      self.optimizer = torch.optim.SGD(self.model.parameters(), lr=1e-3)
  
file_path: mmf/tests/trainers/test_fp16.py
imports: import unittest
  import torch
  from tests.test_utils import SimpleModel, skip_if_no_cuda
  from tests.trainers.test_training_loop import TrainerTrainingLoopMock
  from tests.trainers.test_utils import get_config_with_defaults
label_desc: Use image node_id 1 to create a new MMFTrainerMock object from inherited base classes: TrainerTrainingLoopMock with example: obj = MMFTrainerMock(num_train_data, max_updates, max_epochs, device, fp16_model)