class_docstr: Transformer layer with cross-attention.
code: def __call__(
      self,
      inputs: jnp.ndarray,
      inputs_kv: jnp.ndarray,
      deterministic: bool,
  ) -> jnp.ndarray:
      # Attention block.
      assert inputs.ndim == 3
      x = nn.LayerNorm(dtype=self.dtype)(inputs)
      inputs_kv = nn.LayerNorm(dtype=self.dtype)(inputs_kv)
      x = nn.MultiHeadDotProductAttention(
          num_heads=self.num_heads,
          dtype=self.dtype,
          kernel_init=nn.initializers.xavier_uniform(),
          broadcast_dropout=False,
          deterministic=deterministic,
          dropout_rate=self.attention_dropout_rate,
      )(x, inputs_kv)
      x = nn.Dropout(rate=self.dropout_rate)(x, deterministic)
      x = nn_layers.StochasticDepth(rate=self.stochastic_depth)(
          x, deterministic
      )
      x = x + inputs
  
      # MLP block.
      y = nn.LayerNorm(dtype=self.dtype)(x)
      y = attention_layers.MlpBlock(
          mlp_dim=self.mlp_dim,
          dtype=self.dtype,
          dropout_rate=self.dropout_rate,
          activation_fn=nn.gelu,
          kernel_init=nn.initializers.xavier_uniform(),
          bias_init=nn.initializers.normal(stddev=1e-6),
      )(y, deterministic=deterministic)
      y = nn_layers.StochasticDepth(rate=self.stochastic_depth)(
          y, deterministic
      )
      return y + x
  
imports: import copy
  import functools
  from typing import Any, Optional, Tuple
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import classification_model
  from scenic.model_lib.base_models import model_utils
  from scenic.model_lib.layers import attention_layers
  from scenic.model_lib.layers import nn_layers
  from scenic.projects.baselines import vit
label_desc: Use image node_id 1 for calling the CrossAttentionEncoderBlock obj's underlying member method code with example usage: obj.__call__(inputs, inputs_kv, deterministic) and returns: unknown