class_docstr: Executor class able to run Hummingbird's internal representation of a converted pipeline.
docstr: Args:
      input_names: The names of the input `onnxconverter_common.topology.Variable`s for this model
      output_names: The names of the output `onnxconverter_common.topology.Variable`s generated by this model
      operator_map: A dictionary of operator aliases and related PyTorch implementations
      operators: The list of operators (in a topological order) that will be executed by the model (in order)
      extra_config: Some additional custom configuration parameter
code: def __init__(
      self,
      input_names,
      output_names,
      operator_map,
      operators,
      extra_config,
  ):
      """
      Args:
          input_names: The names of the input `onnxconverter_common.topology.Variable`s for this model
          output_names: The names of the output `onnxconverter_common.topology.Variable`s generated by this model
          operator_map: A dictionary of operator aliases and related PyTorch implementations
          operators: The list of operators (in a topological order) that will be executed by the model (in order)
          extra_config: Some additional custom configuration parameter
      """
      super(Executor, self).__init__()
  
      # Define input \ output names.
      # This is required because the internal variable names may differ from the original (raw) one.
      # This may happen, for instance, because we force our internal naming to be unique.
      def _fix_var_naming(operators, names, mod="input"):
          new_names = []
          map = {}
  
          for op in operators:
              if mod == "input":
                  iter = op.inputs
              else:
                  iter = op.outputs
              for i in iter:
                  for name in names:
                      if i.raw_name == name and name not in map:
                          map[i.raw_name] = i.full_name
              if len(map) == len(names):
                  break
          if map == {}:
              return names
          for name in names:
              new_names.append(map[name])
          return new_names
  
      self._input_names = _fix_var_naming(operators, input_names)
      self._output_names = _fix_var_naming(
          reversed(operators), output_names, "output"
      )
      self._operators = torch.nn.ModuleList(
          [operator_map[operator.full_name] for operator in operators]
      )
      self.max_string_length = None
  
      if constants.MAX_STRING_LENGTH in extra_config:
          self.max_string_length = extra_config[
              constants.MAX_STRING_LENGTH
          ]
  
file_path: hummingbird/hummingbird/ml/_executor.py
imports: import numpy
  import torch
  from hummingbird.ml._utils import pandas_installed, get_device, from_strings_to_ints
  from hummingbird.ml.operator_converters import constants
label_desc: Use image node_id 1 to create a new Executor object from inherited base classes: torch.nn, object with example: obj = Executor(input_names, output_names, operator_map, operators, extra_config)