class_docstr: Class implementing OneHotEncoder operators for ints in PyTorch.
code: def forward(self, *x):
      encoded_tensors = []
  
      if len(x) > 1:
          assert len(x) == self.num_columns
  
          for i in range(self.num_columns):
              input = x[i]
              if input.dtype != torch.int64:
                  input = input.long()
  
              encoded_tensors.append(
                  torch.eq(input, self.condition_tensors[i])
              )
      else:
          # This is already a tensor.
          x = x[0]
          if x.dtype != torch.int64:
              x = x.long()
  
          for i in range(self.num_columns):
              encoded_tensors.append(
                  torch.eq(x[:, i : i + 1], self.condition_tensors[i])
              )
  
      return torch.cat(encoded_tensors, dim=1).float()
  
file_path: hummingbird/hummingbird/ml/operator_converters/_one_hot_encoder_implementations.py
imports: import numpy
  import torch
  from ._physical_operator import PhysicalOperator
  from .None import constants
label_desc: Use image node_id 2 for calling the OneHotEncoder obj's underlying member method code with example usage: obj.forward() and returns: torch