class_docstr: Transformer encoder-decoder layer.
  
  Attributes:
    config: hyperparameters of the module
class_docstr_tok: ["Transformer","encoder-decoder","layer",".","Attributes",":","config",":","hyperparameters","of","the","module"]
docstr: Applies EncoderDecoder1DBlock module.
  
  Args:
    targets: input data for decoder
    encoded: input data from encoder
    decoder_mask: decoder self-attention mask.
    encoder_decoder_mask: encoder-decoder attention mask.
    decode: whether to run in single-position autoregressive mode.
    train: whether to apply dropout
  
  Returns:
    output after transformer encoder-decoder block.
docstr_tok: ["Applies","EncoderDecoder1DBlock","module",".","Args",":","targets",":","input","data","for","decoder","encoded",":","input","data","from","encoder","decoder_mask",":","decoder","self-attention","mask",".","encoder_decoder_mask",":","encoder-decoder","attention","mask",".","decode",":","whether","to","run","in","single-position","autoregressive","mode",".","train",":","whether","to","apply","dropout","Returns",":","output","after","transformer","encoder-decoder","block","."]
code: def __call__(
      self,
      targets,
      encoded,
      decoder_mask=None,
      encoder_decoder_mask=None,
      decode=False,
      train=False,
  ):
      """Applies EncoderDecoder1DBlock module.
  
      Args:
        targets: input data for decoder
        encoded: input data from encoder
        decoder_mask: decoder self-attention mask.
        encoder_decoder_mask: encoder-decoder attention mask.
        decode: whether to run in single-position autoregressive mode.
        train: whether to apply dropout
  
      Returns:
        output after transformer encoder-decoder block.
      """
      cfg = self.config
  
      # Decoder block.
      assert targets.ndim == 3
      x = nn.LayerNorm(dtype=cfg.dtype)(targets)
      x = nn.SelfAttention(
          num_heads=cfg.num_heads,
          dtype=cfg.dtype,
          qkv_features=cfg.qkv_dim,
          kernel_init=nn.initializers.xavier_uniform(),
          bias_init=nn.initializers.normal(stddev=1e-6),
          use_bias=False,
          broadcast_dropout=False,
          dropout_rate=cfg.attention_dropout_rate,
          deterministic=not train,
          decode=decode,
      )(x, decoder_mask)
      x = nn.Dropout(rate=cfg.dropout_rate)(x, deterministic=not train)
      x = x + targets
  
      # Encoder-Decoder block.
      y = nn.LayerNorm(dtype=cfg.dtype)(x)
      y = nn.MultiHeadDotProductAttention(
          num_heads=cfg.num_heads,
          dtype=cfg.dtype,
          qkv_features=cfg.qkv_dim,
          kernel_init=nn.initializers.xavier_uniform(),
          bias_init=nn.initializers.normal(stddev=1e-6),
          use_bias=False,
          broadcast_dropout=False,
          dropout_rate=cfg.attention_dropout_rate,
          deterministic=not train,
      )(y, encoded, encoder_decoder_mask)
  
      y = nn.Dropout(rate=cfg.dropout_rate)(y, deterministic=not train)
      y = y + x
  
      # MLP block.
      z = nn.LayerNorm(dtype=cfg.dtype)(y)
      z = MlpBlock(config=cfg)(z, train=train)
  
      return y + z
  
imports: from typing import Any, Dict, Optional, Tuple
  from absl import logging
  from flax import linen
  from flax.training import common_utils
  from immutabledict import immutabledict
  import jax
  from jax import lax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.base_models import base_model
  from scenic.model_lib.base_models import model_utils
  from scenic.projects.mbt import model
  from scenic.projects.mbt.model import temporal_encode
label_desc: Use image node_id 1 for calling the EncoderDecoder1DBlock obj's underlying member method code with example usage: obj.__call__(targets, encoded, decoder_mask, encoder_decoder_mask, decode, train) and returns: unknown