class_docstr: Data container to encapsulate different types of data, such as images, bounding boxes, etc.
  
  The container itself is iterable according to the format.
  Data container assumes the same coordinate system for all the items it is storing.
  For instance, the behavior shown below is not supported:
  
  .. highlight:: python
  .. code-block:: python
  
      from solt.core import DataContainer
      import numpy as np
  
      img1 = np.ones((100, 100, 3), dtype=np.int32)
      img2 = np.ones((110, 110, 3), dtype=np.int32)
      trf_img = DataContainer.from_dict({'images': (img1, img2)})
  
  Parameters
  ----------
  data : tuple
      Data items stored in a tuple
  fmt : str
      Data format. Example: 'IMMM' - image and three masks.
  transform_settings : dict or None
      Settings for each data item. At this stage, the settings include only padding and interpolation.
      The key in this dict corresponds to the index of the element in the given data tuple.
      The value is another dict, which has all the settings. Segmentation masks have nearest neighbor interpolation
      by default, this can be changed manually if needed.
      Example: ``transform_settings={0:{'interpolation':'bilinear'}, 1: {'interpolation':'bicubic'}}``
docstr: This method converts the DataContainer Content into a dict or a list PyTorch objects
  
  Parameters
  ----------
  as_dict : bool
      Whether to return the result as a dictionary. If a single item is present, then the singular naming
      will be used. If plural, then the plural will be used. The items will be stored and
      sorted a similar manner to the method ``from_dict``: images, masks, keypoints_array, and labels.
      The same applies to a singular case/
  scale_keypoints : bool
      Whether to scale keypoints to 0-1 range. ``True`` by default.
  normalize : bool
      Whether to subtract mean
  mean : torch.Tensor
      Mean to subtract. If None, then the ImageNet mean will be subtracted.
  std : torch.Tensor
      Std to subtract. If None, then the ImageNet std will be subtracted.
docstr_tok: ["This","method","converts","the","DataContainer","Content","into","a","dict","or","a","list","PyTorch","objects","Parameters","--","--","--","--","--","as_dict",":","bool","Whether","to","return","the","result","as","a","dictionary",".","If","a","single","item","is","present",",","then","the","singular","naming","will","be","used",".","If","plural",",","then","the","plural","will","be","used",".","The","items","will","be","stored","and","sorted","a","similar","manner","to","the","method","``","from_dict","``",":","images",",","masks",",","keypoints_array",",","and","labels",".","The","same","applies","to","a","singular","case\/","scale_keypoints",":","bool","Whether","to","scale","keypoints","to","0-1","range",".","``","True","``","by","default",".","normalize",":","bool","Whether","to","subtract","mean","mean",":","torch.Tensor","Mean","to","subtract",".","If","None",",","then","the","ImageNet","mean","will","be","subtracted",".","std",":","torch.Tensor","Std","to","subtract",".","If","None",",","then","the","ImageNet","std","will","be","subtracted","."]
code: def to_torch(
      self,
      as_dict=False,
      scale_keypoints=True,
      normalize=False,
      mean=None,
      std=None,
  ):
      """
      This method converts the DataContainer Content into a dict or a list PyTorch objects
  
      Parameters
      ----------
      as_dict : bool
          Whether to return the result as a dictionary. If a single item is present, then the singular naming
          will be used. If plural, then the plural will be used. The items will be stored and
          sorted a similar manner to the method ``from_dict``: images, masks, keypoints_array, and labels.
          The same applies to a singular case/
      scale_keypoints : bool
          Whether to scale keypoints to 0-1 range. ``True`` by default.
      normalize : bool
          Whether to subtract mean
      mean : torch.Tensor
          Mean to subtract. If None, then the ImageNet mean will be subtracted.
      std : torch.Tensor
          Std to subtract. If None, then the ImageNet std will be subtracted.
      """
      res_dict = {
          "images": list(),
          "masks": list(),
          "keypoints_array": list(),
          "labels": list(),
      }
      not_as_dict = []
      for el, f in zip(self.__data, self.__fmt):
          if f == "I":
              scale = 255.0
              if el.dtype == np.uint16:
                  scale = 65535.0
                  el = el.astype(np.float32)
              img = torch.from_numpy(el.transpose((2, 0, 1))).div(scale)
              if normalize:
                  if mean is None or std is None:
                      mean, std = (
                          self.__imagenet_mean,
                          self.__imagenet_std,
                      )
                  else:
                      mean, std = self.wrap_mean_std(img, mean, std)
  
                  img.sub_(mean)
                  img.div_(std)
              res_dict["images"].append(img)
              not_as_dict.append(img)
  
          elif f == "M":
              mask = torch.from_numpy(el).squeeze().unsqueeze(0).float()
              res_dict["masks"].append(mask)
              not_as_dict.append(mask)
          elif f == "P":
              landmarks = torch.from_numpy(el.data).float()
              if scale_keypoints:
                  landmarks[:, 0] /= el.width - 1
                  landmarks[:, 1] /= el.height - 1
              res_dict["keypoints_array"].append(landmarks)
              not_as_dict.append(landmarks)
          elif f == "L":
              res_dict["labels"].append(el)
              not_as_dict.append(el)
      if not as_dict:
          if len(not_as_dict) == 1:
              return not_as_dict[0]
          return not_as_dict
  
      return self.remap_results_dict(res_dict)
  
imports: import numpy
  import torch
  from solt.constants import ALLOWED_INTERPOLATIONS, ALLOWED_PADDINGS, ALLOWED_TYPES
  from solt.utils import validate_parameter
label_desc: Use image node_id 8 for calling the DataContainer obj's underlying member method code with example usage: obj.to_torch(as_dict, scale_keypoints, normalize, mean, std) and returns: self, not_as_dict, not_as_dict