code: def _convert_parameter(param, dtype):
      try:
          return tf.convert_to_tensor(param, dtype=dtype)
      except ValueError:
          try:
              return tf.cast(param, dtype)
          except ValueError:
              return tf.cast(param(), dtype)
  
imports: from typing import Any, Callable, Dict, Union
  import tensorflow
  from tensorflow_compression.python.layers import parameters
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_parameter(param, dtype) and returns: tf, tf, tf