class_docstr: A list of tensors of different sizes, backed by a (offset, size, data)
  tuple.
  
  Indexing by LongTensor returns a new TensorList with the selected list
  elements (similar to indexing a torch index_select_).
  
  Indexing by an int returns a torch.Tensor with that list element.
class_docstr_tok: ["A","list","of","tensors","of","different","sizes",",","backed","by","a","(","offset",",","size",",","data",")","tuple",".","Indexing","by","LongTensor","returns","a","new","TensorList","with","the","selected","list","elements","(","similar","to","indexing","a","torch","index_select_",")",".","Indexing","by","an","int","returns","a","torch.Tensor","with","that","list","element","."]
code: def sum(self, dim=None, keepdim=False):
      if dim is None:
          return self.data.sum()
      # We're only going to agree to sum across "inner dimensions"
      if dim < 0:
          dim = self.data.ndimension() + dim
      assert dim > 0, "Can't sum along the 'list' dimension"
      return self.__class__(
          self.offsets, self.data.sum(dim, keepdim=keepdim)
      )
  
imports: import torch
label_desc: Use image node_id 23 for calling the TensorList obj's underlying member method code with example usage: obj.sum(dim, keepdim) and returns: self, self