class_docstr: BERT attention layer.
  Based on: BERT (pytorch-transformer)
  https://github.com/huggingface/transformers
code: def __init__(self, config) -> None:
      super().__init__()
      self.num_attention_heads = config.num_attention_heads
      self.attention_head_size = int(
          config.hidden_size / config.num_attention_heads
      )
      self.all_head_size = (
          self.num_attention_heads * self.attention_head_size
      )
      self.query = nn.Linear(config.hidden_size, self.all_head_size)
      self.key = nn.Linear(config.hidden_size, self.all_head_size)
      self.value = nn.Linear(config.hidden_size, self.all_head_size)
      self.dropout = nn.Dropout(config.attention_probs_dropout_prob)
  
imports: from __future__ import annotations
  import math
  from collections.abc import Sequence
  import torch
  from torch import nn
  from monai.config.type_definitions import PathLike
  from monai.utils import optional_import
label_desc: Use image node_id 1 to create a new BertAttention object from inherited base classes: nn with example: obj = BertAttention(config)