code: def master_params(optimizer):
      """Generator to iterate over all parameters in the optimizer param_groups.
  
      When apex is available, uses that to guarantee we get the FP32 copy of the
      parameters when O2 is enabled. Otherwise, iterate ourselves."""
      if apex_available:
          yield from apex.amp.master_params(optimizer)
      else:
          for group in optimizer.param_groups:
              for p in group["params"]:
                  yield p
  
imports: import collections.abc
  import contextlib
  import json
  import logging
  import os
  import time
  from functools import partial
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.nn
  from classy_vision.generic.distributed_util import broadcast_object, is_primary
  from fvcore.common.file_io import PathManager
label_desc: Use image node_id 32 for calling a global function with example usage: master_params(optimizer) without return types