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.
docstr: Args:
      data (array_like): Initial data for the tensor. Can be a list, tuple, NumPy ndarray, scalar, and other
          types.
  
  Returns:
      Data converted to tensor.
docstr_tok: ["Args",":","data","(","array_like",")",":","Initial","data","for","the","tensor",".","Can","be","a","list",",","tuple",",","NumPy","ndarray",",","scalar",",","and","other","types",".","Returns",":","Data","converted","to","tensor","."]
code: def __call__(self, data: Any) -> Tensor:
      """
      Args:
          data (array_like): Initial data for the tensor. Can be a list, tuple, NumPy ndarray, scalar, and other
              types.
  
      Returns:
          Data converted to tensor.
      """
      return torch.tensor(data, dtype=self.dtype, device=self.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 2 for calling the ToTensor obj's underlying member method code with example usage: obj.__call__(data) and returns: torch