class_docstr: Structure that holds a list of images (of possibly
  varying sizes) as a single tensor.
  This works by padding the images to the same size,
  and storing in a field the original sizes of each image
code: def from_tensors(
      cls, tensor_list: List[torch.Tensor]
  ) -> "MultiDimensionalTensor":
      assert len(tensor_list) > 0
      assert isinstance(tensor_list, list)
      for t in tensor_list:
          assert isinstance(t, torch.Tensor), type(t)
          assert t.shape[:-2] == tensor_list[0].shape[:-2], t.shape
  
      image_sizes = [(im.shape[-2], im.shape[-1]) for im in tensor_list]
      image_sizes_tensor = [_as_tensor(x) for x in image_sizes]
      max_size = torch.stack(image_sizes_tensor).max(0).values
      num_tensors = len(tensor_list)
      batch_shape_per_crop = list(tensor_list[0].shape[:-2]) + list(
          max_size
      )
  
      b, c, h, w = batch_shape_per_crop
      dtype = tensor_list[0].dtype
      device = tensor_list[0].device
      nested_output_tensor = torch.zeros(
          (b * num_tensors, c, h, w), dtype=dtype, device=device
      )
      mask = torch.ones(
          (b * num_tensors, h, w), dtype=torch.bool, device=device
      )
  
      for crop_num in range(num_tensors):
          img = tensor_list[crop_num]
          nested_output_tensor[
              (crop_num * b) : (crop_num + 1) * b,
              :,
              : img.shape[2],
              : img.shape[3],
          ].copy_(img)
          mask[
              (crop_num * b) : (crop_num + 1) * b,
              : img.shape[2],
              : img.shape[3],
          ] = False
      return MultiDimensionalTensor(
          nested_output_tensor, mask, image_sizes
      )
  
file_path: vissl/vissl/data/collators/collator_helper.py
imports: from typing import List, Tuple
  import torch
label_desc: Use image node_id 6 for calling the MultiDimensionalTensor obj's underlying member method code with example usage: obj.from_tensors(cls, tensor_list) and returns: MultiDimensionalTensor