class_docstr: FID model (https://arxiv.org/pdf/2007.01282.pdf) with a retrieval module over a knowledge memory.
class_docstr_tok: ["FID","model","(","https",":","\/\/arxiv.org\/pdf\/2007.01282.pdf",")","with","a","retrieval","module","over","a","knowledge","memory","."]
code: def _get_corpus_scores(self, corpus_scores, topk_ids):
      corpus_ids = jnp.take(
          self.local_dataset_idxs.value, topk_ids, axis=0
      )
      return (
          layers.batch_index_select(corpus_scores, corpus_ids),
          corpus_ids,
      )
  
imports: import functools
  from typing import Any, Dict, Mapping, Optional, Tuple, List
  from absl import logging
  import flax.linen
  import jax
  from jax.experimental import host_callback
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.model_lib.base_models import base_model
  from scenic.projects.knowledge_visual_language.data import data_utils
  from scenic.projects.knowledge_visual_language.models import constants
  from scenic.projects.knowledge_visual_language.models import fusion_in_decoder_soft
  from scenic.projects.knowledge_visual_language.models import layers
  from scenic.projects.knowledge_visual_language.models import local_memory
  from scenic.projects.knowledge_visual_language.models import losses
  from scenic.projects.knowledge_visual_language.models import metrics
  from t5x import decoding
label_desc: Use image node_id 2 for calling the KnowledgeFIDModule obj's underlying member method code with example usage: obj._get_corpus_scores(corpus_scores, topk_ids) and returns: layers,  corpus_ids