class_docstr: Dataset wrapping tensors.
  
  Each sample will be retrieved by indexing tensors along the first dimension.
  
  Arguments:
      *tensors (Tensor): tensors that have the same size of the first dimension.
class_docstr_tok: ["Dataset","wrapping","tensors",".","Each","sample","will","be","retrieved","by","indexing","tensors","along","the","first","dimension",".","Arguments",":","*","tensors","(","Tensor",")",":","tensors","that","have","the","same","size","of","the","first","dimension","."]
code: def __getitem__(self, index):
      im, targ = tuple(tensor[index] for tensor in self.tensors)
  
      if self.transform:
          real_transform = transforms.Compose(
              [transforms.ToPILImage(), self.transform]
          )
          im = real_transform(im)
  
      return im, targ
  
imports: import torch.utils.data
  from torch.utils.data import Dataset
  from torchvision import transforms
  from PIL import Image
  import os
  import os.path
  import sys
label_desc: Use image node_id 2 for calling the TensorDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: im,  targ