code: def __init__(self, input_size, hidden_size, num_heads=8):
      super().__init__()
      self.embedding_size = hidden_size
      self.num_heads = num_heads
      if hidden_size % num_heads != 0:
          raise ValueError(
              f"When using multi-head attention, `hidden_size` ({hidden_size}), should be divisible by "
              f"`num_heads` ({num_heads}). Please update the `transformer` section of the model config."
          )
      self.projection_dim = hidden_size // num_heads
      self.query_dense = nn.Linear(input_size, hidden_size)
      self.key_dense = nn.Linear(input_size, hidden_size)
      self.value_dense = nn.Linear(input_size, hidden_size)
      self.combine_heads = nn.Linear(hidden_size, hidden_size)
  
imports: import logging
  import torch
  from torch import nn
  from torch.nn import functional
  from ludwig.utils.torch_utils import get_activation, LudwigModule
label_desc: Use image node_id 1 to create a new MultiHeadSelfAttention object from inherited base classes: LudwigModule with example: obj = MultiHeadSelfAttention(input_size, hidden_size, num_heads)