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.
  
  Args:
    inputs: Input data.
    deterministic: Deterministic or not (to apply dropout).
  
  Returns:
    Output after transformer encoder block.
docstr_tok: ["Applies","Encoder1DBlock","module",".","Args",":","inputs",":","Input","data",".","deterministic",":","Deterministic","or","not","(","to","apply","dropout",")",".","Returns",":","Output","after","transformer","encoder","block","."]
code: def __call__(
      self, inputs: jnp.ndarray, deterministic: bool
  ) -> jnp.ndarray:
      """Applies Encoder1DBlock module.
  
      Args:
        inputs: Input data.
        deterministic: Deterministic or not (to apply dropout).
  
      Returns:
        Output after transformer encoder block.
      """
      # 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 = 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: 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
  from tensorflow.io import gfile
label_desc: Use image node_id 1 for calling the Encoder1DBlock obj's underlying member method code with example usage: obj.__call__(inputs, deterministic) and returns: unknown