class_docstr: Transformer module.
  
  Attributes:
    features: Number of features.
    num_layers: Number of layers for each block.
    num_heads: Number of heads.
    stochastic_droplayer_rate: Stochastic depth droplayer rate.
class_docstr_tok: ["Transformer","module",".","Attributes",":","features",":","Number","of","features",".","num_layers",":","Number","of","layers","for","each","block",".","num_heads",":","Number","of","heads",".","stochastic_droplayer_rate",":","Stochastic","depth","droplayer","rate","."]
code: def __call__(
      self,
      x: jnp.ndarray,
      attn_mask: Optional[jnp.ndarray] = None,
      *,
      deterministic: bool = True,
  ) -> jnp.ndarray:
      for i in range(self.num_layers):
          droplayer_p = (
              i / max(self.num_layers - 1, 1)
          ) * self.stochastic_droplayer_rate
          x = ResidualAttentionBlock(
              num_heads=self.num_heads,
              droplayer_p=droplayer_p,
              name=f"resblocks_{i}",
          )(x, attn_mask, deterministic=deterministic)
      return x
  
imports: import functools
  from typing import Sequence, Optional, Union, Tuple
  import flax.linen
  import jax
  import jax.numpy
label_desc: Use image node_id 1 for calling the Transformer obj's underlying member method code with example usage: obj.__call__(x, attn_mask) and returns: x