class_docstr: Reimplementation of Perceiver.
  
  Perceiver: General Perception with Iterative Attention
  (https://arxiv.org/abs/2103.03206)
code: def linear_disentangle(self, y):
      mean = y.mean(axis=-2, keepdims=True)
      norm_y = l2_normalize(y - mean)
      pairwise_mat = jnp.square(
          jnp.einsum("bqd,btd->bqt", norm_y, norm_y)
      )
      masked_mat = self.batch_triangle_select(pairwise_mat)
      return jnp.mean(masked_mat)
  
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 2 for calling the PerceiverEncoder obj's underlying member method code with example usage: obj.linear_disentangle(y) and returns: jnp