class_docstr: Convert an array_like of class values of shape ``(*,)`` to a tensor of shape ``(*, num_classes)`` that have
  zeros everywhere except where the index of last dimension matches the corresponding value of the input tensor, in
  which case it will be 1.
  
  Note that this class provides a callable object that allows instances of the class to be called as a function. In
  other words, this class wraps the functionality of the one_hot method in the
  `PyTorch <https://pytorch.org/docs/stable/generated/torch.nn.functional.one_hot.html>`__ and allows users to use it
   as a callable instance.
  
  Args:
      num_classes (int, optional): Total number of classes. If set to -1, the number of classes will be inferred as
          one greater than the largest class value in the input data.
      dtype (torch.dtype, optional): The desired data type of returned tensor. Default: if :obj:`None`, infers data
          type from data.
      device (torch.device, optional): The device of the constructed tensor. If :obj:`None` and data is a tensor then
          the device of data is used. If None and data is not a tensor then the result tensor is constructed on the
          CPU.
code: def __init__(
      self,
      num_classes: Optional[int] = -1,
      dtype: Optional[torch.dtype] = None,
      device: Optional[torch.device] = None,
  ) -> None:
      self.num_classes = num_classes
      self.dtype = dtype
      self.device = device
  
file_path: pykale/kale/prepdata/tabular_transform.py
imports: import os
  from typing import Any, Dict, List, Optional, Tuple
  import pandas
  import torch
  import torch.nn.functional
  from torch import Tensor
label_desc: Use image node_id 1 to create a new ToOneHotEncoding object from inherited base classes: object with example: obj = ToOneHotEncoding(num_classes, dtype, device)