code: def check_tensor_shape(
      tensor_tf: tf.Tensor, target_shape: Any
  ) -> bool:
      """
      Return a Tensorflow boolean graph that indicates whether
      sample[features_key] has the specified target shape.
      Only check not None entries of target_shape.
  
      Parameters:
          tensor_tf (tensorflow.Tensor):
              Tensor to check shape for.
          target_shape (Any):
              Target shape to compare tensor to.
  
      Returns:
          bool:
              `True` if shape is valid, `False` otherwise (as TF boolean).
      """
      result = tf.constant(True)
      for i, target_length in enumerate(target_shape):
          if target_length:
              result = tf.logical_and(
                  result,
                  tf.equal(
                      tf.constant(target_length), tf.shape(tensor_tf)[i]
                  ),
              )
      return result
  
file_path: spleeter/spleeter/utils/tensor.py
imports: from typing import Any, Callable, Dict
  import pandas
  import tensorflow
label_desc: Use image node_id 7 for calling a global function with example usage: check_tensor_shape(tensor_tf, target_shape) and returns: result