class_docstr: Executor class able to run Hummingbird's internal representation of a converted pipeline.
code: def forward(self, *inputs):
      with torch.no_grad():
          assert len(self._input_names) == len(inputs) or (
              DataFrame is not None
              and isinstance(inputs[0], DataFrame)
              and not self.check_dataframe_to_array
              and len(self._input_names) == len(inputs[0].columns)
          ), "number of inputs or number of columns in the dataframe do not match with the expected number of inputs {}".format(
              self._input_names
          )
  
          if DataFrame is not None and isinstance(inputs[0], DataFrame):
              # Split the dataframe into column ndarrays.
              inputs = inputs[0]
              input_names = list(inputs.columns)
              splits = [
                  inputs[input_names[idx]]
                  for idx in range(len(input_names))
              ]
              splits = [df.to_numpy().reshape(-1, 1) for df in splits]
              inputs = tuple(splits)
          inputs = [*inputs]
          variable_map = {}
          device = get_device(self)
  
          # Maps data inputs to the expected variables.
          for i, input_name in enumerate(self._input_names):
              input_ = inputs[i]
              if type(input_) is list:
                  input_ = np.array(input_)
              if type(input_) is np.ndarray:
                  # Convert string arrays into int32.
                  if (
                      input_.dtype.kind
                      in constants.SUPPORTED_STRING_TYPES
                  ):
                      assert self.max_string_length is not None
  
                      input_ = from_strings_to_ints(
                          input_, self.max_string_length
                      )
                  elif input_.dtype.kind == "M":  # Datetime
                      # We convert into seconds from 1970-1-1.
                      input_ = (
                          input_
                          - np.datetime64(
                              "1970-01-01T00:00:00.000000000"
                          )
                      ).astype(np.int64) / 1000000000
                  input_ = torch.from_numpy(input_)
              elif type(input_) is not torch.Tensor:
                  raise RuntimeError(
                      "Inputer tensor {} of not supported type {}".format(
                          input_name, type(input_)
                      )
                  )
              if input_.dtype == torch.float64:
                  # We convert double precision arrays into single precision. Sklearn does the same.
                  input_ = input_.float()
              if device is not None and device.type != "cpu":
                  input_ = input_.to(device)
              variable_map[input_name] = input_
  
          # Evaluate all the operators in the topology by properly wiring inputs \ outputs
          for operator in self._operators:
              outputs = operator(
                  *(
                      variable_map[input_name]
                      for input_name in operator.inputs
                  )
              )
  
              if len(operator.outputs) == 1:
                  variable_map[operator.outputs[0]] = outputs
              else:
                  for i, output_name in enumerate(operator.outputs):
                      variable_map[output_name] = outputs[i]
  
          # Prepare and return the output.
          if len(self._output_names) == 1:
              return variable_map[self._output_names[0]]
          else:
              return tuple(
                  variable_map[output_name]
                  for output_name in self._output_names
              )
  
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 2 for calling the Executor obj's underlying member method code with example usage: obj.forward() and returns: variable_map, tuple