class_docstr: Self-attention block of Transformer.
  
  Attributes:
    num_heads: Number of heads.
    droplayer_p: Layer drop probability.
class_docstr_tok: ["Self-attention","block","of","Transformer",".","Attributes",":","num_heads",":","Number","of","heads",".","droplayer_p",":","Layer","drop","probability","."]
docstr: Get drop pattern for drop layer.
code: def get_drop_pattern(self, x, deterministic):
      """Get drop pattern for drop layer."""
      if not deterministic and self.droplayer_p:
          shape = (x.shape[0],) + (1,) * (x.ndim - 1)
          return jax.random.bernoulli(
              self.make_rng("dropout"), self.droplayer_p, shape
          ).astype("float32")
      else:
          return 0.0
  
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 ResidualAttentionBlock obj's underlying member method code with example usage: obj.get_drop_pattern(x, deterministic) and returns: jax, int