docstr: Get the processed batch of raw data given.
  
  Parameters
  ----------
  data
      The raw data to process
  onnx_tracing
      If the output is used for onnx tracing.
  batch_size
      The batch_size of output batch.
      If onnx_tracing, it will only output one mini-batch, and all int tensor values will be converted to long.
  to_numpy
      Output numpy array if True. Only valid if not onnx_tracing.
  require_label
      Whether do we put label data into the output batch
  
  Returns
  -------
  Tensor or numpy array.
  The output processed batch could be used for export/evaluate deployed model.
docstr_tok: ["Get","the","processed","batch","of","raw","data","given",".","Parameters","--","--","--","--","--","data","The","raw","data","to","process","onnx_tracing","If","the","output","is","used","for","onnx","tracing",".","batch_size","The","batch_size","of","output","batch",".","If","onnx_tracing",",","it","will","only","output","one","mini-batch",",","and","all","int","tensor","values","will","be","converted","to","long",".","to_numpy","Output","numpy","array","if","True",".","Only","valid","if","not","onnx_tracing",".","require_label","Whether","do","we","put","label","data","into","the","output","batch","Returns","--","--","--","-","Tensor","or","numpy","array",".","The","output","processed","batch","could","be","used","for","export\/evaluate","deployed","model","."]
code: def get_processed_batch_for_deployment(
      self,
      data: Union[pd.DataFrame, dict],
      onnx_tracing: bool = False,
      batch_size: int = None,
      to_numpy: bool = True,
      requires_label: bool = False,
      truncate_long_and_double: bool = False,
  ):
      """
      Get the processed batch of raw data given.
  
      Parameters
      ----------
      data
          The raw data to process
      onnx_tracing
          If the output is used for onnx tracing.
      batch_size
          The batch_size of output batch.
          If onnx_tracing, it will only output one mini-batch, and all int tensor values will be converted to long.
      to_numpy
          Output numpy array if True. Only valid if not onnx_tracing.
      require_label
          Whether do we put label data into the output batch
  
      Returns
      -------
      Tensor or numpy array.
      The output processed batch could be used for export/evaluate deployed model.
      """
      data = self.data_to_df(data=data)
      column_types = self.infer_column_types(
          column_types=self._column_types,
          data=data,
          is_train=False,
      )
      df_preprocessor = self.get_df_preprocessor_per_run(
          df_preprocessor=self._df_preprocessor,
          data=data,
          column_types=column_types,
          is_train=False,
      )
      if self._fit_called:
          df_preprocessor._column_types = (
              self.update_image_column_types(data=data)
          )
      data_processors = self.get_data_processors_per_run(
          data_processors=self._data_processors,
          requires_label=requires_label,
          is_train=False,
      )
  
      batch = self.process_batch(
          data=data,
          df_preprocessor=df_preprocessor,
          data_processors=data_processors,
      )
  
      input_keys = self._model.input_keys
  
      # Perform tracing on cpu
      device_type = "cpu"
      num_gpus = 0
      strategy = "dp"  # default used in inference.
      device = torch.device(device_type)
      dtype = infer_precision(
          num_gpus=num_gpus,
          precision=self._config.env.precision,
          cpu_only_warning=False,
          as_torch=True,
      )
  
      # Move model data to the specified device
      for key in input_keys:
          inp = batch[key]
          # support mixed precision on floating point inputs, and leave integer inputs (for language models) untouched.
          if inp.dtype.is_floating_point:
              batch[key] = inp.to(device, dtype=dtype)
          else:
              batch[key] = inp.to(device)
      self._model.to(device)
  
      # Truncate input data types for TensorRT (only support: bool, int32, half, float)
      if truncate_long_and_double:
          for k in batch:
              if batch[k].dtype == torch.int64:
                  batch[k] = batch[k].to(torch.int32)
  
      # Data filtering
      ret = {}
      for k in batch:
          if input_keys and k not in input_keys:
              continue
          if onnx_tracing:
              ret[k] = (
                  batch[k].long()
                  if isinstance(batch[k], torch.IntTensor)
                  else batch[k]
              )
          elif to_numpy:
              ret[k] = batch[k].cpu().detach().numpy().astype(int)
          else:
              ret[k] = batch[k]
      if not onnx_tracing:
          if batch_size:
              raise NotImplementedError(
                  "We should split the batch here."
              )  # TODO
      return ret
  
file_path: autogluon/multimodal/src/autogluon/multimodal/utils/export.py
imports: import io
  import logging
  import os
  import warnings
  from collections import defaultdict
  from typing import Dict, List, Optional, Union
  import pandas
  import torch
  from ..constants import CATEGORICAL, HF_TEXT, IMAGE_PATH, MMDET_IMAGE, NULL, NUMERICAL, TEXT, TIMM_IMAGE
  from ..models.fusion import AbstractMultimodalFusionModel
  from ..models.huggingface_text import HFAutoModelForTextPrediction
  from ..models.mmdet_image import MMDetAutoModelForObjectDetection
  from ..models.timm_image import TimmAutoModelForImagePrediction
  from .environment import infer_precision
  from .onnx import OnnxModule, onnx_get_dynamic_axes
label_desc: Use image node_id 4 for calling the ExportMixin obj's underlying member method code with example usage: obj.get_processed_batch_for_deployment(data, onnx_tracing, batch_size, to_numpy, requires_label, truncate_long_and_double) and returns: ret