code: def get_master(
      opt: Optimizer,  # Optimizer from which to retrieve model params
      flat_master: bool = False,  # Flatten fp32 params into a vector for better performance
  ) -> list:  # List of fp16 params, and list of fp32 params
      "Creates fp16 model params given an initialized `Optimizer`, also returning fp32 model params."
      model_params = [
          [
              param
              for param in pg
              if getattr(param, "requires_grad", False)
              and hasattr(param, "data")
          ]
          for pg in opt.param_lists
      ]
      if flat_master:
          master_params = []
          for pg in model_params:
              mp = parameters_to_vector(
                  [param.data.float() for param in pg]
              )
              mp = nn.Parameter(mp, requires_grad=True)
              if mp.grad is None:
                  mp.grad = mp.new(*mp.size())
              master_params.append([mp])
      else:
          master_params = [
              [
                  nn.Parameter(
                      param.data.clone().float().detach(),
                      requires_grad=True,
                  )
                  for param in pg
              ]
              for pg in model_params
          ]
      return model_params, master_params
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from torch.cuda.amp import GradScaler, autocast
  from torch.cuda.amp.grad_scaler import OptState
  from ..fp16_utils import convert_network, model_grads_to_master_grads, master_params_to_model_params
  from torch.nn.utils import parameters_to_vector
label_desc: Use image node_id 4 for calling a global function with example usage: get_master(opt, flat_master) and returns: model_params,  master_params