class_docstr: Implements an abstract preprocessor object which performs casting, resizing, batching and normalization.
  
  Args:
  ----
      output_size: expected size of each page in format (H, W)
      batch_size: the size of page batches
      mean: mean value of the training distribution by channel
      std: standard deviation of the training distribution by channel
class_docstr_tok: ["Implements","an","abstract","preprocessor","object","which","performs","casting",",","resizing",",","batching","and","normalization",".","Args",":","--","--","output_size",":","expected","size","of","each","page","in","format","(","H",",","W",")","batch_size",":","the","size","of","page","batches","mean",":","mean","value","of","the","training","distribution","by","channel","std",":","standard","deviation","of","the","training","distribution","by","channel"]
docstr: Gather samples into batches for inference purposes
  
  Args:
  ----
      samples: list of samples (tf.Tensor)
  
  Returns:
  -------
      list of batched samples
docstr_tok: ["Gather","samples","into","batches","for","inference","purposes","Args",":","--","--","samples",":","list","of","samples","(","tf.Tensor",")","Returns",":","--","--","--","-","list","of","batched","samples"]
code: def batch_inputs(self, samples: List[tf.Tensor]) -> List[tf.Tensor]:
      """Gather samples into batches for inference purposes
  
      Args:
      ----
          samples: list of samples (tf.Tensor)
  
      Returns:
      -------
          list of batched samples
      """
      num_batches = int(math.ceil(len(samples) / self.batch_size))
      batches = [
          tf.stack(
              samples[
                  idx
                  * self.batch_size : min(
                      (idx + 1) * self.batch_size, len(samples)
                  )
              ],
              axis=0,
          )
          for idx in range(int(num_batches))
      ]
  
      return batches
  
file_path: doctr/doctr/models/preprocessor/tensorflow.py
imports: import math
  from typing import Any, List, Tuple, Union
  import numpy
  import tensorflow
  from doctr.transforms import Normalize, Resize
  from doctr.utils.multithreading import multithread_exec
  from doctr.utils.repr import NestedObject
label_desc: Use image node_id 2 for calling the PreProcessor obj's underlying member method code with example usage: obj.batch_inputs(samples) and returns: batches