docstr: Reorder all RAG encoder states.
  
  pass the last encoder states
docstr_tok: ["Reorder","all","RAG","encoder","states",".","pass","the","last","encoder","states"]
code: def reorder_encoder_states(
      self,
      encoder_states: Tuple[torch.Tensor, ...],
      indices: torch.LongTensor,
  ) -> Tuple[
      torch.Tensor,
      torch.Tensor,
      List[List[Document]],
      torch.Tensor,
      torch.BoolTensor,
  ]:
      """
      Reorder all RAG encoder states.
  
      pass the last encoder states
      """
      new_enc, new_mask = super().reorder_encoder_states(
          encoder_states[:-1], indices
      )
      if not torch.is_tensor(indices):
          indices = torch.LongTensor(indices).to(new_enc.device)
      return new_enc, new_mask, encoder_states[-1][indices]
  
imports: import torch
  import torch.nn.functional
  import copy
  from typing import Optional, List, Tuple, Any, Dict, Union
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_agent import Batch
  from parlai.core.message import Message
  from parlai.agents.rag.retrievers import Document
  from parlai.agents.fid.fid import SearchQueryFiDAgent, WizIntGoldDocRetrieverFiDAgent
  import parlai.utils.logging
  from projects.seeker.agents.seeker_modules import ComboFidModel
  from projects.seeker.agents.seeker import ComboFidAgent, SeekerAgent
  from projects.fits.agents.director_bb2 import DirectorFidAgent, DirectorFidModelMixin
label_desc: Use image node_id 2 for calling the DirectorComboFidModel obj's underlying member method code with example usage: obj.reorder_encoder_states(encoder_states, indices) and returns: new_enc,  new_mask,  encoder_states