class_docstr: GPT2 with Retriever Model.
  
  A GPT2 model that receives documents from a retriever.
class_docstr_tok: ["GPT2","with","Retriever","Model",".","A","GPT2","model","that","receives","documents","from","a","retriever","."]
code: def reorder_decoder_incremental_state(self, incremental_state, inds):
      new_incr_state = []
      for layer_past in incremental_state:
          if torch.is_tensor(layer_past):
              new_incr_state.append(
                  torch.index_select(layer_past, 1, inds)
              )
          else:
              # newer versions of HF split up the intermediate outputs
              assert isinstance(layer_past, tuple)
              layer_past = torch.stack(layer_past, dim=0)
              new_incr_state.append(
                  torch.index_select(layer_past, 1, inds)
              )
  
      return tuple(new_incr_state)
  
imports: from typing import Optional, Type, Tuple, List, Dict, Any
  import torch
  import torch.nn
  from parlai.agents.fid.fid import FidModel, concat_enc_outs
  from parlai.agents.hugging_face.gpt2 import GPT2Decoder, Gpt2Agent
  from parlai.agents.rag.args import RetrieverType
  from parlai.agents.rag.modules import RagModel
  from parlai.agents.rag.retrievers import Document, BLANK_DOC, SearchQuerySearchEngineRetriever, retriever_factory, RagRetriever
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
  import parlai.utils.logging
  from projects.seeker.agents.seeker_modules import ComboFidSearchQuerySearchEngineRetriever
  from projects.seeker.agents.seeker_modules import combo_fid_retriever_factory, interleave_fid_combo_outputs, ComboFidModel
label_desc: Use image node_id 13 for calling the GPT2WithRetrieverModel obj's underlying member method code with example usage: obj.reorder_decoder_incremental_state(incremental_state, inds) and returns: tuple