class_docstr: Reimplementation of Perceiver.
  
  Perceiver: General Perception with Iterative Attention
  (https://arxiv.org/abs/2103.03206)
code: def __call__(self, encoded, encoded_mask, use_dropout=False):
      cfg = self.t5_config
      rel_emb = t5_layers.RelativePositionBiases(
          num_buckets=32,
          max_distance=128,
          num_heads=cfg.num_heads,
          dtype=cfg.dtype,
          embedding_init=nn.initializers.variance_scaling(
              1.0, "fan_avg", "uniform"
          ),
      )
  
      # [batch, length] -> [batch, length, emb_dim]
      encoded = t5_layers.LayerNorm(dtype=cfg.dtype)(encoded)
      bsz = encoded.shape[0]
      y = jnp.asarray(self.perceive_embedding, dtype=cfg.dtype)
      y = jnp.repeat(y, bsz, axis=0)
      y = nn.Dropout(rate=cfg.dropout_rate, broadcast_dims=(-2,))(
          y, deterministic=not use_dropout
      )
      y = y.astype(cfg.dtype)
  
      mask = jnp.ones([bsz, self.perceiver_output_dim]).astype(bool)
      encoder_decoder_mask = t5_layers.make_attention_mask(
          mask, encoded_mask, dtype=self.dtype
      )
  
      for _ in range(self.num_fusion_layers):
          # [batch, length, emb_dim] -> [batch, length, emb_dim]
          y = t5_network.DecoderLayer(
              config=cfg, relative_embedding=rel_emb
          )(
              y,
              encoded,
              deterministic=not use_dropout,
              encoder_decoder_mask=encoder_decoder_mask,
              decode=False,
          )
  
      return y * 4, mask, self.linear_disentangle(y)
  
imports: import functools
  from typing import Optional, Sequence
  from flax import linen
  import jax
  import jax.numpy
  from scenic.projects.knowledge_visual_language.models import constants
  from t5x.examples.t5 import layers
  from t5x.examples.t5 import network
label_desc: Use image node_id 3 for calling the PerceiverEncoder obj's underlying member method code with example usage: obj.__call__(encoded, encoded_mask, use_dropout) and returns: unknown,  mask,  self