code: def test_to_tensor(self) -> None:
      # Check that ImgToTensor and torchvision.transforms.ToTensor
      # are mostly equivalent
  
      # PIL.Image
      a = ImgToTensor()(RAND_PIL)
      b = ToTensor()(RAND_PIL)
      self.assertTrue(torch.allclose(a, b))
  
      # Numpy array
      c = ImgToTensor()(RAND_NUMPY)
      d = ToTensor()(RAND_NUMPY)
      self.assertTrue(torch.allclose(c, d))
  
file_path: vissl/tests/test_transforms.py
imports: import unittest
  import numpy
  import torch
  from PIL import Image
  from torchvision.transforms import Compose, ToTensor
  from vissl.data.ssl_transforms.img_pil_to_multicrop import ImgPilToMultiCrop
  from vissl.data.ssl_transforms.img_pil_to_tensor import ImgToTensor
  from vissl.data.ssl_transforms.mnist_img_pil_to_rgb_mode import MNISTImgPil2RGB
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.test_utils import augly_test, gpu_test, in_temporary_directory, run_integration_test
label_desc: Use image node_id 1 for calling the TestTransform obj's underlying member method code with example usage: obj.test_to_tensor() without return types