class_docstr: Transformer encoder layer.
  
  Attributes:
    mlp_dim: Dimension of the mlp on top of attention block.
    num_heads: Number of self-attention heads.
    dtype: The dtype of the computation (default: float32).
    dropout_rate: Dropout rate.
    attention_dropout_rate: Dropout for attention heads.
    stochastic_depth: probability of dropping a layer linearly grows from 0 to
      the provided value.
  
  Returns:
    output after transformer encoder block.
docstr: Applies Encoder1DBlock module.
docstr_tok: ["Applies","Encoder1DBlock","module","."]
code: def __call__(
      self,
      inputs: jnp.ndarray,
      deterministic: bool,
      use_aux_dropout: bool,
  ) -> jnp.ndarray:
      """Applies Encoder1DBlock module."""
      # Attention block.
      assert inputs.ndim == 3
      x = nn.LayerNorm(dtype=self.dtype)(inputs)
      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, x)
      x = SplitDropout(
          rate=self.dropout_rate, aux_rate=self.aux_dropout_rate
      )(x, deterministic, use_aux_dropout)
      x = (
          SplitStochasticDepth(
              self.stochastic_depth, self.aux_stochastic_depth
          )(x, deterministic, use_aux_dropout)
          + 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)
  
      return (
          SplitStochasticDepth(
              self.stochastic_depth, self.aux_stochastic_depth
          )(y, deterministic, use_aux_dropout)
          + x
      )
  
imports: from typing import Any, Callable, Optional, Sequence
  from absl import logging
  import flax
  import flax.linen
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.model_lib.base_models.multilabel_classification_model import MultiLabelClassificationModel
  from scenic.model_lib.layers import attention_layers
  from scenic.model_lib.layers import nn_layers
  import scipy
label_desc: Use image node_id 1 for calling the Encoder1DBlock obj's underlying member method code with example usage: obj.__call__(inputs, deterministic, use_aux_dropout) and returns: unknown