class_docstr: Served as a wrapper of id-based entity and featurized entity.
  
  self.tensor is an id-based entity list
  self.tensor_list is a featurized entity list
  
  This class maintains the indexing and slicing of these two parallel
  representations.
class_docstr_tok: ["Served","as","a","wrapper","of","id-based","entity","and","featurized","entity",".","self.tensor","is","an","id-based","entity","list","self.tensor_list","is","a","featurized","entity","list","This","class","maintains","the","indexing","and","slicing","of","these","two","parallel","representations","."]
code: def __getitem__(
      self, index: Union[int, slice, LongTensorType]
  ) -> "EntityList":
      if isinstance(index, int):
          return self[index : index + 1]
  
      if isinstance(
          index, (torch.LongTensor, torch.cuda.LongTensor)
      ) or isinstance(index, int):
          tensor_sub = self.tensor[index]
          tensor_list_sub = self.tensor_list[index]
          return type(self)(tensor_sub, tensor_list_sub)
  
      if isinstance(index, slice):
          start, stop, step = index.indices(len(self))
          if step != 1:
              raise ValueError(
                  "Expected slice with step 1, got %d" % step
              )
          tensor_sub = self.tensor[start:stop]
          tensor_list_sub = self.tensor_list[start:stop]
          return type(self)(tensor_sub, tensor_list_sub)
  
      raise KeyError("Unknown index type: %s" % type(index))
  
file_path: PyTorch-BigGraph/torchbiggraph/entitylist.py
imports: from typing import Any, Sequence, Union
  import torch
  from torchbiggraph.tensorlist import TensorList
  from torchbiggraph.types import LongTensorType
label_desc: Use image node_id 11 for calling the EntityList obj's underlying member method code with example usage: obj.__getitem__(index) and returns: self, type, type