class_docstr: This module wraps the self-attention with the output-layer, similar to the architecture in BERT.
  Details in the paper:
  [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, Devlin et al, 2019]
  (https://api.semanticscholar.org/CorpusID:52967399)
  
  # Parameters
  
  hidden_size: `int`
  num_attention_heads: `int`
  attention_dropout: `float` (default = `0.0`)
      Dropout probability for the `SelfAttention` layer.
  hidden_dropout: `float` (default = `0.0`)
      Dropout probability for the `OutputLayer`.
code: def __init__(
      self,
      hidden_size: int,
      num_attention_heads: int,
      attention_dropout: float = 0.0,
      hidden_dropout: float = 0.0,
      is_cross_attention: bool = False,
      is_decoder: bool = False,
  ):
      super().__init__()
      self.self = SelfAttention(
          hidden_size,
          num_attention_heads,
          attention_dropout,
          is_cross_attention=is_cross_attention,
          is_decoder=is_decoder,
      )
      self.output = OutputLayer(
          hidden_size, hidden_size, hidden_dropout
      )
  
imports: from typing import Union, Optional, TYPE_CHECKING
  from dataclasses import dataclass
  import torch
  from allennlp.common import FromParams
  from allennlp.modules.transformer.transformer_module import TransformerModule
  from allennlp.modules.transformer.activation_layer import ActivationLayer
  from allennlp.modules.transformer.attention_module import SelfAttention, AttentionOutput
  from allennlp.modules.transformer.output_layer import OutputLayer
  from allennlp.modules.transformer.util import FloatT
label_desc: Use image node_id 1 to create a new AttentionLayer object from inherited base classes: TransformerModule, FromParams with example: obj = AttentionLayer(hidden_size, num_attention_heads, attention_dropout, hidden_dropout, is_cross_attention, is_decoder)