code: def test_sharding(self):
      self.trainer = MMFTrainerMock(self.config_oss, 100, 2, 0.04)
  
      self.assertTrue(isinstance(self.trainer.optimizer, OSS))
  
      self.assertTrue(
          isinstance(self.trainer.model, ShardedDataParallel)
      )
  
      self.assertTrue(
          isinstance(self.trainer.scaler, ShardedGradScaler)
      )
  
      self.assertEqual(self.trainer.current_iteration, 0)
      self.trainer.training_loop()
      self.assertEqual(self.trainer.current_iteration, 4)
  
file_path: mmf/tests/trainers/test_sharded_ddp.py
imports: import os
  import unittest
  import torch
  from mmf.common.registry import registry
  from mmf.trainers.mmf_trainer import MMFTrainer
  from mmf.utils.build import build_optimizer
  from omegaconf import OmegaConf
  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 4 for calling the TestShardedDDP obj's underlying member method code with example usage: obj.test_sharding() without return types