class_docstr: LabelEncoder over string data types.
  When the ONNX backend is selected, this operator only works for PyTorch => 1.8.0.
code: def __init__(
      self, logical_operator, classes, device, extra_config={}
  ):
      super(StringLabelEncoder, self).__init__(
          logical_operator, transformer=True
      )
      self.regression = False
      self.num_columns = len(classes)
      self.max_word_length = max([len(cat) for cat in classes])
      while self.max_word_length % 4 != 0:
          self.max_word_length += 1
  
      data_type = "|S" + str(self.max_word_length)
      max_length = 0
      if constants.MAX_STRING_LENGTH in extra_config:
          extra_config[constants.MAX_STRING_LENGTH]
      extra_config[constants.MAX_STRING_LENGTH] = max(
          max_length, self.max_word_length
      )
  
      # Sort the classes and convert to torch.int32
      self.max_word_length = self.max_word_length // 4
      classes_conv = (
          torch.from_numpy(
              np.array(sorted(set(classes)), dtype=data_type).view(
                  np.int32
              )
          )
          .detach()
          .clone()
      )
      classes_conv = classes_conv.view(1, -1, self.max_word_length)
  
      self.condition_tensors = torch.nn.Parameter(
          classes_conv, requires_grad=False
      )
  
file_path: hummingbird/hummingbird/ml/operator_converters/_label_encoder_implementations.py
imports: import torch
  import numpy
  from ._physical_operator import PhysicalOperator
  from .None import constants
label_desc: Use image node_id 1 to create a new StringLabelEncoder object from inherited base classes: PhysicalOperator, torch.nn with example: obj = StringLabelEncoder(logical_operator, classes, device, extra_config)