code: def __init__(
      self,
      hidden_size,
      num_attention_heads,
      attention_probs_dropout_prob,
      output_attentions=False,
  ):
      super(BertSelfAttention, self).__init__()
      if hidden_size % num_attention_heads != 0:
          raise ValueError(
              "The hidden_size must be a multiple of the number of attention "
              "heads, but got {} % {} != 0"
              % (hidden_size, num_attention_heads)
          )
  
      self.num_attention_heads = num_attention_heads
      self.attention_head_size = int(hidden_size / num_attention_heads)
      self.all_head_size = (
          self.num_attention_heads * self.attention_head_size
      )
  
      self.query = nn.Linear(hidden_size, self.all_head_size)
      self.key = nn.Linear(hidden_size, self.all_head_size)
      self.value = nn.Linear(hidden_size, self.all_head_size)
  
      self.dropout = nn.Dropout(attention_probs_dropout_prob)
      self.output_attentions = output_attentions
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn import ReLU, Swish, GELU
  import math
  from ppdet.core.workspace import register
  from ..shape_spec import ShapeSpec
label_desc: Use image node_id 1 to create a new BertSelfAttention object from inherited base classes: nn with example: obj = BertSelfAttention(hidden_size, num_attention_heads, attention_probs_dropout_prob, output_attentions)