code: def check_valid_graph_pooling_input(
      data: type_alias.TensorLike,
      pool_map: tf.sparse.SparseTensor,
      sizes: type_alias.TensorLike,
  ):
      """Checks that the inputs are valid for graph pooling.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        data: A `float` tensor with shape `[A1, ..., An, V1, C]`.
        pool_map: A SparseTensor with the same type as `data` and with shape `[A1,
          ..., An, V2, V1]`.
        sizes: An `int` tensor of shape `[A1, ..., An, 2]`. Can be `None`.
  
      Raises:
        TypeError: if the input types are invalid.
        ValueError: if the input dimensions are invalid.
      """
      if not data.dtype.is_floating:
          raise TypeError("'data' must have a float type.")
      if pool_map.dtype != data.dtype:
          raise TypeError(
              "'pool_map' and 'data' must have the same type."
          )
      if sizes is not None and not sizes.dtype.is_integer:
          raise TypeError("'sizes' must have an integer type.")
      if not isinstance(pool_map, tf.sparse.SparseTensor):
          raise ValueError("'pool_map' must be a SparseTensor.")
  
      data_ndims = data.shape.ndims
      shape.check_static(
          tensor=data, tensor_name="data", has_rank_greater_than=1
      )
      shape.check_static(
          tensor=pool_map, tensor_name="pool_map", has_rank=data_ndims
      )
      if not _is_dynamic_shape(tensors=(data, pool_map)):
          shape.compare_dimensions(
              tensors=(data, pool_map),
              tensor_names=("data", "pool_map"),
              axes=(-2, -1),
          )
      if sizes is None:
          shape.compare_batch_dimensions(
              tensors=(data, pool_map),
              tensor_names=("data", "pool_map"),
              last_axes=-3,
              broadcast_compatible=False,
          )
      else:
          shape.check_static(
              tensor=sizes, tensor_name="sizes", has_rank=data_ndims - 1
          )
          shape.compare_batch_dimensions(
              tensors=(data, pool_map, sizes),
              tensor_names=("data", "pool_map", "sizes"),
              last_axes=(-3, -3, -2),
              broadcast_compatible=False,
          )
  
file_path: graphics/tensorflow_graphics/geometry/convolution/utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 3 for calling a global function with example usage: check_valid_graph_pooling_input(data, pool_map, sizes) without return types