class_docstr: ``SampleList`` is used to collate a list of ``Sample`` into a batch during batch
  preparation. It can be thought of as a merger of list of Dicts into a single Dict.
  
  If ``Sample`` contains an attribute 'text' of size (2) and there are 10 samples in
  list, the returned ``SampleList`` will have an attribute 'text' which is a tensor
  of size (10, 2).
  
  Args:
      samples (type): List of ``Sample`` from which the ``SampleList``
                      will be created.
  
  Usage::
  
      >>> sample_list = [
              Sample({"text": torch.tensor(2)}),
              Sample({"text": torch.tensor(2)})
          ]
      >>> sample_list.text
      torch.tensor([2, 2])
docstr: Similar to ``.to`` function on a `torch.Tensor`. Moves all of the
  tensors present inside the ``SampleList`` to a particular device. If an
  attribute's value is not a tensor, it is ignored and kept as it is.
  
  Args:
      device (str|torch.device): Device on which the ``SampleList`` should
                                 moved.
      non_blocking (bool): Whether the move should be non_blocking. Default: True
  
  Returns:
      SampleList: a SampleList moved to the ``device``.
code: def to(self, device, non_blocking=True):
      """Similar to ``.to`` function on a `torch.Tensor`. Moves all of the
      tensors present inside the ``SampleList`` to a particular device. If an
      attribute's value is not a tensor, it is ignored and kept as it is.
  
      Args:
          device (str|torch.device): Device on which the ``SampleList`` should
                                     moved.
          non_blocking (bool): Whether the move should be non_blocking. Default: True
  
      Returns:
          SampleList: a SampleList moved to the ``device``.
  
      """
      fields = self.keys()
      sample_list = self.copy()
      if not isinstance(device, torch.device):
          if not isinstance(device, str):
              raise TypeError(
                  "device must be either 'str' or "
                  "'torch.device' type, {} found".format(type(device))
              )
          device = torch.device(device)
  
      for field in fields:
          if hasattr(sample_list[field], "to"):
              sample_list[field] = sample_list[field].to(
                  device, non_blocking=non_blocking
              )
  
      return sample_list
  
imports: import collections
  import collections.abc
  import warnings
  from collections import OrderedDict
  from typing import Any, Dict, Union
  import torch
label_desc: Use image node_id 18 for calling the SampleList obj's underlying member method code with example usage: obj.to(device, non_blocking) and returns: sample_list