code: def __init__(
      self,
      *,
      model,
      use_fp16=False,
      fp16_scale_growth=1e-3,
      initial_lg_loss_scale=INITIAL_LOG_LOSS_SCALE,
  ):
      self.model = model
      self.use_fp16 = use_fp16
      self.fp16_scale_growth = fp16_scale_growth
  
      self.model_params = list(self.model.parameters())
      self.master_params = self.model_params
      self.param_groups_and_shapes = None
      self.lg_loss_scale = initial_lg_loss_scale
  
      if self.use_fp16:
          self.param_groups_and_shapes = get_param_groups_and_shapes(
              self.model.named_parameters()
          )
          self.master_params = make_master_params(
              self.param_groups_and_shapes
          )
          self.model.convert_to_fp16()
  
imports: import numpy
  import torch
  import torch.nn
  from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
  from .None import logger
label_desc: Use image node_id 1 to create a new MixedPrecisionTrainer object  with example: obj = MixedPrecisionTrainer()