class_docstr: Model optimized using TensorRT with a tensorflow interface.
  
  This class can be used exactly in the same way as a tf.Module or
  keras.Model object.
  At prediction time it takes as input tensorflow tensors given as positional
  arguments.
  
  Attributes:
      network_parameters (ModelParams): The model parameters as batch
              size, input and output sizes.
      engine (any): The tensorRT engine.
      input_names (List[str]): Names associated to the model input tensors.
      output_names (List[str]): Names associated to the model output tensors.
      cuda_stream (any, optional): Stream used for communication with Nvidia
          GPUs.
      nvidia_logger (any, optional): Logger used by the Nvidia service.
class_docstr_tok: ["Model","optimized","using","TensorRT","with","a","tensorflow","interface",".","This","class","can","be","used","exactly","in","the","same","way","as","a","tf.Module","or","keras.Model","object",".","At","prediction","time","it","takes","as","input","tensorflow","tensors","given","as","positional","arguments",".","Attributes",":","network_parameters","(","ModelParams",")",":","The","model","parameters","as","batch","size",",","input","and","output","sizes",".","engine","(","any",")",":","The","tensorRT","engine",".","input_names","(","List","[","str","]",")",":","Names","associated","to","the","model","input","tensors",".","output_names","(","List","[","str","]",")",":","Names","associated","to","the","model","output","tensors",".","cuda_stream","(","any",",","optional",")",":","Stream","used","for","communication","with","Nvidia","GPUs",".","nvidia_logger","(","any",",","optional",")",":","Logger","used","by","the","Nvidia","service","."]
docstr: Predict on the input tensors.
  
  Note that the input tensors must be on the same batch. If a sequence
  of tensors is given when the model is expecting a single input tensor
  (with batch size >= 1) an error is raised.
  
  Args:
      input_tensors (Tuple[np.ndarray]): Input tensors belonging to
          the same batch. The tensors are expected having dimensions
          (batch_size, dim1, dim2, ...).
  
  Returns:
      Tuple[np.ndarray]: Output tensors. Note that the output tensors
          does not correspond to the prediction on the input tensors
          with a 1 to 1 mapping. In fact the output tensors are produced
          as the multiple-output of the model given a (multi-) tensor
          input.
code: def run(self, *input_tensors: np.ndarray) -> Tuple[np.ndarray, ...]:
      """Predict on the input tensors.
  
      Note that the input tensors must be on the same batch. If a sequence
      of tensors is given when the model is expecting a single input tensor
      (with batch size >= 1) an error is raised.
  
      Args:
          input_tensors (Tuple[np.ndarray]): Input tensors belonging to
              the same batch. The tensors are expected having dimensions
              (batch_size, dim1, dim2, ...).
  
      Returns:
          Tuple[np.ndarray]: Output tensors. Note that the output tensors
              does not correspond to the prediction on the input tensors
              with a 1 to 1 mapping. In fact the output tensors are produced
              as the multiple-output of the model given a (multi-) tensor
              input.
      """
      cuda_input_arrays = [
          polygraphy.cuda.DeviceArray(
              shape=tuple(input_tensor.shape), dtype=input_tensor.dtype
          ).copy_from(input_tensor, stream=self.cuda_stream)
          for input_tensor in input_tensors
      ]
      input_shapes = (
          [tuple(input_tensor.shape) for input_tensor in input_tensors]
          if self.network_parameters.dynamic_info is not None
          else None
      )
      return tuple(self._predict_array(cuda_input_arrays, input_shapes))
  
imports: import json
  import os
  from abc import ABC
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Any, Union, Dict, Type, List, Tuple, Generator, Optional
  import numpy
  from loguru import logger
  from nebullvm.config import NVIDIA_FILENAMES
  from nebullvm.core.models import Device, DeviceType, ModelParams, DeepLearningFramework
  from nebullvm.operations.inference_learners.base import BaseInferenceLearner, LearnerMetadata, PytorchBaseInferenceLearner, TensorflowBaseInferenceLearner, NumpyBaseInferenceLearner
  from nebullvm.optional_modules.tensorflow import tensorflow
  from nebullvm.optional_modules.tensor_rt import tensorrt, polygraphy
  from nebullvm.optional_modules.torch import torch, ScriptModule
  from nebullvm.tools.data import DataManager
  from nebullvm.tools.transformations import MultiStageTransformation, VerifyContiguity
label_desc: Use image node_id 1 for calling the NumpyONNXTensorRTInferenceLearner obj's underlying member method code with example usage: obj.run() and returns: tuple