code: def fp32_to_float16(val, float16_converter):
      """Convert fp32 `val` to fp16/bf16"""
  
      def half_conversion(val):
          val_typecheck = val
          if isinstance(val_typecheck, (Parameter, Variable)):
              val_typecheck = val.data
          if isinstance(val_typecheck, _FLOAT_TYPES):
              val = float16_converter(val)
          return val
  
      return conversion_helper(val, half_conversion)
  
imports: import torch
  from torch.autograd import Variable
  from torch.nn.parameter import Parameter
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling a global function with example usage: fp32_to_float16(val, float16_converter) and returns: conversion_helper, val