class_docstr: Convert a list of m (H x W x C) numpy.ndarrays in the range [0, 255]
  to a torch.FloatTensor of shape (C x m x H x W) in the range [0, 1.0]
class_docstr_tok: ["Convert","a","list","of","m","(","H","x","W","x","C",")","numpy.ndarrays","in","the","range","[","0",",","255","]","to","a","torch.FloatTensor","of","shape","(","C","x","m","x","H","x","W",")","in","the","range","[","0",",","1.0","]"]
docstr: Args: clip (list of numpy.ndarray): clip (list of images)
  to be converted to tensor.
docstr_tok: ["Args",":","clip","(","list","of","numpy.ndarray",")",":","clip","(","list","of","images",")","to","be","converted","to","tensor","."]
code: def __call__(self, clip):
      """
      Args: clip (list of numpy.ndarray): clip (list of images)
      to be converted to tensor.
      """
      # Retrieve shape
      if isinstance(clip[0], np.ndarray):
          h, w, ch = clip[0].shape
          assert (
              ch == self.channel_nb
          ), "Got {0} instead of 3 channels".format(ch)
      elif isinstance(clip[0], Image.Image):
          w, h = clip[0].size
      else:
          raise TypeError(
              "Expected numpy.ndarray or PIL.Image\
              but got list of {0}".format(
                  type(clip[0])
              )
          )
  
      np_clip = np.zeros([self.channel_nb, len(clip), int(h), int(w)])
  
      # Convert
      for img_idx, img in enumerate(clip):
          if isinstance(img, np.ndarray):
              pass
          elif isinstance(img, Image.Image):
              img = np.array(img, copy=False)
          else:
              raise TypeError(
                  "Expected numpy.ndarray or PIL.Image\
                  but got list of {0}".format(
                      type(clip[0])
                  )
              )
          img = imageutils.convert_img(img)
          np_clip[:, img_idx, :, :] = img
      if self.numpy:
          if self.div_255:
              np_clip = np_clip / 255.0
          return np_clip
  
      else:
          tensor_clip = torch.from_numpy(np_clip)
  
          if not isinstance(tensor_clip, torch.FloatTensor):
              tensor_clip = tensor_clip.float()
          if self.div_255:
              tensor_clip = torch.div(tensor_clip, 255)
          return tensor_clip
  
file_path: gluon-cv/gluoncv/torch/data/transforms/videotransforms/volume_transforms.py
imports: import numpy
  from PIL import Image
  import torch
  from .utils import images
label_desc: Use image node_id 2 for calling the ClipToTensor obj's underlying member method code with example usage: obj.__call__(clip) and returns: np_clip, tensor_clip