class_docstr: Preserves the original input data without any transformations.
  
  Due to the restrictions of torch.Tensor, the encoding function only accepts types:
  
  - (nested) lists of numbers
  - np.ndarray of numbers, or
  - torch.Tensor
  
  Nonetypes are automatically converted into nans. This cannot be decoded.
  If self.handle_nan is True, then all nans are converted to zeros and not decoded back.
  
  The decode function takes in a torch.Tensor and converts it to a list of numbers.
docstr: Converts input data into a torch tensor with NaN handling, if necessary.
  
  :param column_data: Input iterable of numerical data
  :returns: Torch tensor of the data type
docstr_tok: ["Converts","input","data","into","a","torch","tensor","with","NaN","handling",",","if","necessary",".",":","param","column_data",":","Input","iterable","of","numerical","data",":","returns",":","Torch","tensor","of","the","data","type"]
code: def encode(
      self, column_data: Iterable[Union[float, int]]
  ) -> torch.Tensor:
      """
      Converts input data into a torch tensor with NaN handling, if necessary.
  
      :param column_data: Input iterable of numerical data
      :returns: Torch tensor of the data type
      """
      if isinstance(column_data, torch.Tensor):
          res = column_data
      else:
          res = np.array(
              column_data, dtype=float
          )  # converts None to nan
          res = torch.Tensor(res)
  
      if self.handle_nan:
          res = torch.nan_to_num(res)
      return res
  
file_path: lightwood/lightwood/encoder/identity/identity.py
imports: import numpy
  from typing import List, Iterable, Union
  import torch
  from lightwood.encoder.base import BaseEncoder
label_desc: Use image node_id 3 for calling the IdentityEncoder obj's underlying member method code with example usage: obj.encode(column_data) and returns: res