class_docstr: Given 1-D `indices` tensor, gather elements at `i` in `indices` from all the
  blobs in `record`. If a blob is a values blob of a list, all the elements
  included by the list's lengths blob are gathered. For example,
  
  Input:
      indices = [0, 2]
      record:a = [[0, 1], [2, 3], [4, 5], [6, 7]]
      record:b:lengths = [0, 1, 2, 3]
      record:b:items = [0, 1, 2, 3, 4, 5]
  
  Output:
      a = [[0, 1], [4, 5]]
      b:lengths = [0, 2]
      b:items = [1, 2]
  
  This supports nested list.
code: def _gather_list(self, net, record, lengths_blob, output_record):
      self._gather_scalar(
          net, record.lengths, lengths_blob, output_record.lengths
      )
      if lengths_blob is None:
          lengths_blob = record.lengths()
      else:
          # TODO(kittipat): This is a hacky solution until LengthsSum for int
          # is implemented
          lengths_float = net.Cast(
              record.lengths(),
              net.NextScopedBlob(str(record.lengths()) + "_float"),
              to=core.DataType.FLOAT,
          )
          lengths_blob_float = net.LengthsSum(
              [lengths_float, lengths_blob],
              net.NextScopedBlob(
                  str(record.lengths()) + "_nested_float"
              ),
          )
          lengths_blob = net.Cast(
              lengths_blob_float,
              net.NextScopedBlob(str(record.lengths()) + "_nested"),
              to=core.DataType.INT32,
          )
      self._dispatch(
          net, record._items, lengths_blob, output_record._items
      )
  
file_path: pytorch/caffe2/python/layers/gather_record.py
imports: from caffe2.python import core, schema
  from caffe2.python.layers.layers import ModelLayer
label_desc: Use image node_id 4 for calling the GatherRecord obj's underlying member method code with example usage: obj._gather_list(net, record, lengths_blob, output_record) without return types