parameters: (self, inputs, **kwargs)
return_statement: return namedtupledict('Outputs', output_names)(*outputs)
docstring: Execute the prepared engine and return the outputs as a named tuple.
  
          inputs -- Input tensor(s) as a Numpy array or list of Numpy arrays.
docstring_summary: Execute the prepared engine and return the outputs as a named tuple.
docstring_tokens: Execute the prepared engine and return the outputs as a named tuple .
function: def run(self, inputs, **kwargs):
          """Execute the prepared engine and return the outputs as a named tuple.
  
          inputs -- Input tensor(s) as a Numpy array or list of Numpy arrays.
          """
          if isinstance(inputs, np.ndarray):
              inputs = [inputs]
          outputs = self.engine.run(inputs)
          output_names = [output.name for output in self.engine.outputs]
          for i, (name, array) in enumerate(zip(output_names, outputs)):
              output_shape = self._output_shapes[name]
              # HACK WAR for unknown output shape in run_node
              if output_shape == (-99,):
                  # WAR for TRT requiring at least 2 dims (NC)
                  min_dims = 2
                  if _tensorrt_version()[0] < 4:
                      # WAR for TRT only supporting 4D (NCHW) tensors
                      min_dims = 4
                  if array.ndim == min_dims:
                      npadding_dims = count_trailing_ones(array.shape)
                      if npadding_dims > 0:
                          outputs[i] = array.reshape(
                              array.shape[:-npadding_dims])
              else:
                  # HACK WAR replace fixed batch dim with variable
                  output_shape = (-1,) + output_shape[1:]
                  outputs[i] = array.reshape(output_shape)
          outputs_tuple = namedtupledict('Outputs', output_names)(*outputs)
          return namedtupledict('Outputs', output_names)(*outputs)
function_tokens: def run ( self , inputs , * * kwargs ) : if isinstance ( inputs , np . ndarray ) : inputs = [ inputs ] outputs = self . engine . run ( inputs ) output_names = [ output . name for output in self . engine . outputs ] for i , ( name , array ) in enumerate ( zip ( output_names , outputs ) ) : output_shape = self . _output_shapes [ name ] # HACK WAR for unknown output shape in run_node if output_shape == ( - 99 , ) : # WAR for TRT requiring at least 2 dims (NC) min_dims = 2 if _tensorrt_version ( ) [ 0 ] < 4 : # WAR for TRT only supporting 4D (NCHW) tensors min_dims = 4 if array . ndim == min_dims : npadding_dims = count_trailing_ones ( array . shape ) if npadding_dims > 0 : outputs [ i ] = array . reshape ( array . shape [ : - npadding_dims ] ) else : # HACK WAR replace fixed batch dim with variable output_shape = ( - 1 , ) + output_shape [ 1 : ] outputs [ i ] = array . reshape ( output_shape ) outputs_tuple = namedtupledict ( 'Outputs' , output_names ) ( * outputs ) return namedtupledict ( 'Outputs' , output_names ) ( * outputs )