code: def __call__(self, image, label):
      if not isinstance(image, np.ndarray) or not isinstance(
          label, np.ndarray
      ):
          raise (
              RuntimeError(
                  "segtransform.ToTensor() only handle np.ndarray"
                  "[eg: data readed by cv2.imread()].\n"
              )
          )
      if len(image.shape) > 3 or len(image.shape) < 2:
          raise (
              RuntimeError(
                  "segtransform.ToTensor() only handle np.ndarray with 3 dims or 2 dims.\n"
              )
          )
      if len(image.shape) == 2:
          image = np.expand_dims(image, axis=2)
      if not len(label.shape) == 2:
          raise (
              RuntimeError(
                  "segtransform.ToTensor() only handle np.ndarray labellabel with 2 dims.\n"
              )
          )
  
      image = torch.from_numpy(image.transpose((2, 0, 1)))
      if not isinstance(image, torch.FloatTensor):
          image = image.float()
      label = torch.from_numpy(label)
      if not isinstance(label, torch.LongTensor):
          label = label.long()
      return image, label
  
imports: import random
  import math
  import numpy
  import numbers
  import collections
  import cv2
  import torch
  import time
label_desc: Use image node_id 1 for calling the ToTensor obj's underlying member method code with example usage: obj.__call__(image, label) and returns: image,  label