class_docstr: Convert an array_like data to a tensor of the same shape. 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
  `torch.tensor <https://pytorch.org/docs/stable/generated/torch.tensor.html>`__ and allows users to use it as a
  callable instance.
  
  Args:
      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,
      dtype: Optional[torch.dtype] = None,
      device: Optional[torch.device] = None,
  ) -> None:
      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 ToTensor object from inherited base classes: object with example: obj = ToTensor(dtype, device)