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: Get a new ``SampleList`` generated from the current ``SampleList``
  but contains only the attributes passed in `fields` argument
  
  Args:
      fields (List[str]): Attributes whose ``SampleList`` will be made.
  
  Returns:
      SampleList: SampleList containing only the attribute values of the fields
      which were passed.
code: def get_fields(self, fields):
      """Get a new ``SampleList`` generated from the current ``SampleList``
      but contains only the attributes passed in `fields` argument
  
      Args:
          fields (List[str]): Attributes whose ``SampleList`` will be made.
  
      Returns:
          SampleList: SampleList containing only the attribute values of the fields
          which were passed.
  
      """
      current_fields = self.fields()
  
      return_list = SampleList()
  
      for field in fields:
          if field not in current_fields:
              raise AttributeError(
                  "{} not present in SampleList. "
                  "Valid choices are {}".format(field, current_fields)
              )
          return_list.add_field(field, self[field])
  
      return return_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 11 for calling the SampleList obj's underlying member method code with example usage: obj.get_fields(fields) and returns: return_list