code: def stop_gradient_of_real_or_complex_entries(nested):
      """Calls `tf.stop_gradient` on real or complex elements of a nested structure.
  
      Args:
        nested: The nested structure. May contain `Tensor`s with different `dtype`s.
  
      Returns:
        The resulting nested structure.
      """
  
      def _one_part(tensor):
          tensor = tf.convert_to_tensor(tensor)
          if dtype_util.is_floating(
              tensor.dtype
          ) or dtype_util.is_complex(tensor.dtype):
              return tf.stop_gradient(tensor)
          else:
              return tensor
  
      return tf.nest.map_structure(_one_part, nested)
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import gradient
  from tensorflow.python.util import nest
label_desc: Use image node_id 12 for calling a global function with example usage: stop_gradient_of_real_or_complex_entries(nested) and returns: tf, tf, tensor