code: def get_loss_scale(flags_obj, default_for_fp16):
      if flags_obj.loss_scale == "dynamic":
          return flags_obj.loss_scale
      elif flags_obj.loss_scale is not None:
          return float(flags_obj.loss_scale)
      elif flags_obj.dtype == "fp32":
          return 1  # No loss scaling is needed for fp32
      else:
          assert flags_obj.dtype == "fp16"
          return default_for_fp16
  
file_path: autodist/examples/benchmark/utils/flags/_performance.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import multiprocessing
  from absl import flags
  import tensorflow
  from utils.flags._conventions import help_wrap
label_desc: Use image node_id 2 for calling a global function with example usage: get_loss_scale(flags_obj, default_for_fp16) and returns: flags_obj, float, int, default_for_fp16