code: def get_model(norm_type, checkpointed, mixed_precision):
      assert norm_type in NORM_TYPES, norm_type
      assert checkpointed in [True, False], checkpointed
      assert mixed_precision in MP_TYPES
  
      model = Sequential(Linear(3, 2), norm_type(2))
  
      if mixed_precision == "fp16":
          # Set param.data and buffers as fp16
          for p in model.parameters():
              p.data = p.data.half()
          for m in model:
              for n, b in m.named_buffers():
                  setattr(m, n, b.half())
      elif mixed_precision == "call_half":
          model.half()
  
      if checkpointed:
          model = checkpoint_wrapper(model)
  
      return model
  
file_path: fairscale/tests/nn/checkpoint/test_checkpoint_activations_norm.py
imports: import pytest
  import torch
  from torch.nn import BatchNorm2d, LayerNorm, Linear, Sequential
  from torch.optim import SGD
  from fairscale.fair_dev.testing.testing import objects_are_equal
  from fairscale.internal import torch_version
  from fairscale.nn.checkpoint.checkpoint_activations import checkpoint_wrapper
label_desc: Use image node_id 1 for calling a global function with example usage: get_model(norm_type, checkpointed, mixed_precision) and returns: model