class_docstr: A container that holds info about partial batches for `predict()`.
docstr: Returns the number of elements in a potentially partial batch.
code: def get_real_batch_size(self, dataset_batch):
      """Returns the number of elements in a potentially partial batch."""
      if isinstance(dataset_batch, (tuple, list)):
          dataset_batch = dataset_batch[0]
  
      assert nest.flatten(dataset_batch)
  
      def _find_any_tensor(batch_features):
          tensors = [
              x
              for x in nest.flatten(batch_features)
              if tensor_util.is_tf_type(x)
          ]
          if not tensors:
              raise ValueError(
                  "Cannot find any Tensor in features dict."
              )
          return tensors[0]
  
      return backend.cast(
          backend.shape(_find_any_tensor(dataset_batch))[0],
          dtype="int64",
      )
  
file_path: tensorflow/tensorflow/python/keras/engine/partial_batch_padding_handler.py
imports: import numpy
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.keras import backend
  from tensorflow.python.ops import array_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling the PartialBatchPaddingHandler obj's underlying member method code with example usage: obj.get_real_batch_size(dataset_batch) and returns: backend, tensors