code: def _get_unique_dtype(dtype, error_message_fn):
      """Gets unique singleton dtype from a structure."""
      dtypes = set(
          tf.nest.flatten(tf.nest.map_structure(tf.as_dtype, dtype))
      )
      if len(dtypes) > 1:
          raise TypeError(error_message_fn(dtype))
      return dtypes.pop()
  
file_path: probability/spinoffs/inference_gym/inference_gym/targets/vector_model.py
imports: import collections
  import functools
  import tensorflow.compat.v2
  import tensorflow_probability
  from tensorflow_probability.python.internal import prefer_static
  from inference_gym.targets import model
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling a global function with example usage: _get_unique_dtype(dtype, error_message_fn) and returns: dtypes