code: def __init__(
      self,
      n_head,
      d_model,
      d_head,
      dropout,
      dropatt=0.1,
      pre_lnorm=False,
      condition_types=[],
  ):
      super(MultiHeadAttn, self).__init__()
  
      self.n_head = n_head
      self.d_model = d_model
      self.d_head = d_head
      self.scale = 1 / (d_head**0.5)
      self.pre_lnorm = pre_lnorm
  
      self.qkv_net = nn.Linear(d_model, 3 * n_head * d_head)
      self.drop = nn.Dropout(dropout)
      self.dropatt = nn.Dropout(dropatt)
      self.o_net = nn.Linear(n_head * d_head, d_model, bias=False)
      self.layer_norm = ConditionalLayerNorm(
          d_model,
          condition_dim=d_model,
          condition_types=condition_types,
      )
  
imports: from typing import Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from nemo.collections.tts.modules.submodules import ConditionalInput, ConditionalLayerNorm, LinearNorm
  from nemo.collections.tts.parts.utils.helpers import get_mask_from_lengths
  from nemo.core.classes import NeuralModule, adapter_mixins, typecheck
  from nemo.core.neural_types.elements import EncodedRepresentation, LengthsType, MaskType, TokenIndex
  from nemo.core.neural_types.neural_type import NeuralType
label_desc: Use image node_id 1 to create a new MultiHeadAttn object from inherited base classes: nn with example: obj = MultiHeadAttn(n_head, d_model, d_head, dropout, dropatt, pre_lnorm, condition_types)