code: def __init__(self, n_head: int, d_model: int, dropout: float = 0.0):
      super().__init__()
  
      self.n_head = n_head
      self.d_model = d_model
      self.d_k = self.d_q = self.d_v = d_model // n_head
      self.dropout = MonteCarloDropout(p=dropout)
  
      self.v_layer = nn.Linear(self.d_model, self.d_v)
      self.q_layers = nn.ModuleList(
          [
              nn.Linear(self.d_model, self.d_q)
              for _ in range(self.n_head)
          ]
      )
      self.k_layers = nn.ModuleList(
          [
              nn.Linear(self.d_model, self.d_k)
              for _ in range(self.n_head)
          ]
      )
      self.attention = _ScaledDotProductAttention()
      self.w_h = nn.Linear(self.d_v, self.d_model, bias=False)
  
      self.init_weights()
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from darts.logging import get_logger
  from darts.utils.torch import MonteCarloDropout
label_desc: Use image node_id 1 to create a new _InterpretableMultiHeadAttention object from inherited base classes: nn with example: obj = _InterpretableMultiHeadAttention(n_head, d_model, dropout)