class_docstr: Transformer encoder-decoder layer.
  
  Args:
    config: TransformerConfig dataclass containing hyperparameters.
docstr: Applies EncoderDecoder1DBlock module.
  
  Args:
    inputs: input data for decoder
    decoder_mask: decoder self-attention mask.
    encoder_decoder_mask: encoder-decoder attention mask.
  
  Returns:
    output after transformer encoder-decoder block.
docstr_tok: ["Applies","EncoderDecoder1DBlock","module",".","Args",":","inputs",":","input","data","for","decoder","decoder_mask",":","decoder","self-attention","mask",".","encoder_decoder_mask",":","encoder-decoder","attention","mask",".","Returns",":","output","after","transformer","encoder-decoder","block","."]
code: def __call__(
      self, inputs, decoder_mask=None, encoder_decoder_mask=None
  ):
      """Applies EncoderDecoder1DBlock module.
  
      Args:
        inputs: input data for decoder
        decoder_mask: decoder self-attention mask.
        encoder_decoder_mask: encoder-decoder attention mask.
  
      Returns:
        output after transformer encoder-decoder block.
      """
      config = self.config
  
      # Decoder block.
      assert inputs.ndim == 3
      x = nn.LayerNorm(
          dtype=config.dtype,
          bias_init=nn.with_logical_partitioning(
              nn.initializers.zeros, ("embed",)
          ),
          scale_init=nn.with_logical_partitioning(
              nn.initializers.ones, ("embed",)
          ),
      )(inputs)
      x = nn.MultiHeadDotProductAttention(
          num_heads=config.num_heads,
          dtype=config.dtype,
          qkv_features=config.qkv_dim,
          kernel_init=nn.with_logical_partitioning(
              config.kernel_init, ("embed", "kv")
          ),
          bias_init=nn.with_logical_partitioning(
              config.bias_init, ("embed",)
          ),
          use_bias=False,
          broadcast_dropout=False,
          dropout_rate=config.attention_dropout_rate,
          deterministic=config.deterministic,
          decode=config.decode,
      )(x, mask=decoder_mask)
      x = nn.Dropout(rate=config.dropout_rate)(
          x, deterministic=config.deterministic
      )
      x = x + inputs
  
      # MLP block.
      z = nn.LayerNorm(
          dtype=config.dtype,
          bias_init=nn.with_logical_partitioning(
              nn.initializers.zeros, ("embed",)
          ),
          scale_init=nn.with_logical_partitioning(
              nn.initializers.ones, ("embed",)
          ),
      )(x)
      z = MlpBlock(config=config)(z)
  
      return x + z
  
imports: from typing import Callable, Any, Optional
  from flax import linen
  from flax import struct
  from jax import lax
  import jax.numpy
  import numpy
label_desc: Use image node_id 1 for calling the EncoderDecoder1DBlock obj's underlying member method code with example usage: obj.__call__(inputs, decoder_mask, encoder_decoder_mask) and returns: unknown