class_docstr: Modification of FID (https://arxiv.org/pdf/2007.01282.pdf) model.
  
  Take continous embedding of retrieved document at middle fusion layer
  instead of whole sequence at input.
class_docstr_tok: ["Modification","of","FID","(","https",":","\/\/arxiv.org\/pdf\/2007.01282.pdf",")","model",".","Take","continous","embedding","of","retrieved","document","at","middle","fusion","layer","instead","of","whole","sequence","at","input","."]
code: def setup(self):
      super().setup()
      self.n_compressed_tokens = self.config.n_compressed_tokens
      # Project retrieved knowledge into encoder space
      self.value_perceiver = layers.PerceiverEncoder(
          **self.t5_config,
          num_fusion_layers=self.config.num_fusion_layers,
          perceiver_output_dim=self.n_compressed_tokens,
          name="value_perceiver",
      )
      # Query & Key Head for Retrieval
      self.compress_head = nn.Dense(
          features=self.key_dim,
          dtype=self.dtype,
          name="head_out",
          use_bias=False,
      )
      self.query_head = layers.TransformerHead(
          **self.t5_config,
          num_head_layers=self.config.num_fusion_layers,
          out_head=self.compress_head,
          key_dim=self.key_dim,
          name="query_head",
      )
      self.key_head = layers.TransformerHead(
          **self.t5_config,
          num_head_layers=self.config.num_fusion_layers,
          out_head=self.compress_head,
          key_dim=self.key_dim,
          name="key_head",
      )
      self.att_transform = layers.AffineTransform()
  
imports: from typing import Any, Dict, Optional
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  from scenic.model_lib.base_models import base_model
  from scenic.projects.knowledge_visual_language.models import constants
  from scenic.projects.knowledge_visual_language.models import layers
  from scenic.projects.knowledge_visual_language.models import losses
  from scenic.projects.knowledge_visual_language.models import metrics
  from scenic.projects.knowledge_visual_language.models import vit
  from scenic.projects.t5 import layers
  from scenic.projects.t5 import model
label_desc: Use image node_id 1 for calling the FusionInDecoderSoftModule obj's underlying member method code with example usage: obj.setup() without return types