class_docstr: A data class to hold images of different sizes in a batch.
  
  It contains `tensors` to hold padded images to the maximum size and `mask` to
  indicate the actual image region of each padded image
code: def to(self, *args, **kwargs):
      cast_tensor = self.tensors.to(*args, **kwargs)
      cast_mask = (
          self.mask.to(*args, **kwargs)
          if self.mask is not None
          else None
      )
      return type(self)(cast_tensor, cast_mask)
  
imports: from typing import List
  import torch
  from torch import Tensor
label_desc: Use image node_id 2 for calling the NestedTensor obj's underlying member method code with example usage: obj.to() and returns: type