class_docstr: Multi-Head Attention implementation from https://arxiv.org/abs/1706.03762
  used for Movie+MCAN
class_docstr_tok: ["Multi-Head","Attention","implementation","from","https",":","\/\/arxiv.org\/abs\/1706.03762","used","for","Movie+MCAN"]
code: def __init__(self, dim: int, num_attn: int, dropout: float = 0.1):
      super().__init__()
      self.p_attn = None
      self.h = num_attn
      self.d_k = dim // num_attn
      self.linears = nn.ModuleList(
          [nn.Linear(dim, dim) for _ in range(4)]
      )
      self.dropout = nn.Dropout(p=dropout)
  
imports: import math
  from typing import Optional, Tuple, Type
  import torch
  from mmf.modules.layers import GatedTanh, ModalCombineLayer, TransformLayer
  from torch import nn
label_desc: Use image node_id 1 to create a new MovieMcanMultiHeadAttention object from inherited base classes: nn with example: obj = MovieMcanMultiHeadAttention(dim, num_attn, dropout)