class_docstr: Convert a ``PIL Image`` or ``numpy.ndarray`` to tensor. Pytorch tensors
  are left as is.
class_docstr_tok: ["Convert","a","``","PIL","Image","``","or","``","numpy.ndarray","``","to","tensor",".","Pytorch","tensors","are","left","as","is","."]
docstr: Args:
      pic (PIL Image or numpy.ndarray): Image to be converted to tensor.
  
  Returns:
      Tensor: Converted image.
docstr_tok: ["Args",":","pic","(","PIL","Image","or","numpy.ndarray",")",":","Image","to","be","converted","to","tensor",".","Returns",":","Tensor",":","Converted","image","."]
code: def __call__(self, pic):
      """
      Args:
          pic (PIL Image or numpy.ndarray): Image to be converted to tensor.
  
      Returns:
          Tensor: Converted image.
      """
      if isinstance(pic, Tensor):
          return pic
      return super().__call__(pic)
  
imports: from typing import List, TYPE_CHECKING, Tuple
  from torch import Tensor
  from torch.utils.data import DataLoader
  from torchvision.transforms import ToTensor
  from torchvision.utils import make_grid
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.evaluation.metric_definitions import PluginMetric
  from avalanche.evaluation.metric_results import MetricResult, TensorImage, MetricValue
  from avalanche.evaluation.metric_utils import get_metric_name
  from typing_extensions import Literal
label_desc: Use image node_id 1 for calling the _MaybeToTensor obj's underlying member method code with example usage: obj.__call__(pic) and returns: super, pic