class_docstr: T5 decoder as a separate model.
  
  This module contains the decoder part of a pretrained T5. It is useful when
  adopting the pretrained T5 decoder as a part of a larger network. Note that
  the embedding layer should be created outside the module and provided as a
  parameter `shared_embedding` to share it in other parts of the network (e.g.,
  text encoder). If `shared_embedding` is not provided, the embedding layer is
  created within the module.
  
  Attributes:
    vocab_size: Size of the vocabulary.
    emb_dim: Size of the embeddings.
    num_heads: Number of attention heads.
    num_encoder_layers: Number of encoder layers.
    num_decoder_layers: Number of decoder layers.
    head_dim: Size of the embeddings in each head.
    mlp_dim: Size of the MLP output embeddings.
    dropout_rate: Dropout rate.
    dtype: Data type.
    mlp_activations: Sequence of activations in MLP.
    logits_via_embedding: Use the embedding weights for computing logits.
    shared_embedding: Optional. Embedding layer that is shared outside this
      module. If not given, a non-shared embedding layer will be created within
      the module.
code: def setup(self):
      self.t5_config = t5.T5Config(
          vocab_size=self.vocab_size,
          emb_dim=self.emb_dim,
          num_heads=self.num_heads,
          num_encoder_layers=self.num_encoder_layers,
          num_decoder_layers=self.num_decoder_layers,
          head_dim=self.head_dim,
          mlp_dim=self.mlp_dim,
          dropout_rate=self.dropout_rate,
          dtype=self.dtype,
          mlp_activations=self.mlp_activations,
          logits_via_embedding=self.logits_via_embedding,
          float32_attention_logits=self.float32_attention_logits,
      )
      if self.shared_embedding is None:
          self.nonshared_embedding = t5_layers.Embed(
              num_embeddings=self.vocab_size,
              features=self.emb_dim,
              dtype=self.dtype,
              attend_dtype=jnp.float32,  # For logit training stability.
              embedding_init=nn.initializers.normal(stddev=1.0),
              one_hot=True,
              name="token_embedder",
          )
          embedding_layer = self.nonshared_embedding
      else:
          embedding_layer = self.shared_embedding
      self.decoder_module = t5.Decoder(self.t5_config, embedding_layer)
  
imports: import functools
  from typing import Any, Dict, Mapping, Optional, Sequence, Tuple
  import flax.linen
  import jax
  import jax.numpy
  from scenic.model_lib.base_models import base_model
  from t5x import decoding
  from t5x.examples.t5 import layers
  from t5x.examples.t5 import network
  from t5x.models import DecodeFnCallable
label_desc: Use image node_id 1 for calling the T5Decoder obj's underlying member method code with example usage: obj.setup() without return types