code: def __init__(self, decoder_hidden_state_dim, context_dim, **kwargs):
      super().__init__(decoder_hidden_state_dim, context_dim)
  
      self.input_proj = None
      force_projection = kwargs.get("force_projection", False)
      if force_projection or decoder_hidden_state_dim != context_dim:
          self.input_proj = Linear(
              decoder_hidden_state_dim, context_dim, bias=True
          )
      self.src_length_masking = kwargs.get("src_length_masking", True)
  
file_path: translate/pytorch_translate/attention/dot_attention.py
imports: import numpy
  import torch
  import torch.nn.functional
  from pytorch_translate.attention import attention_utils, BaseAttention, register_attention
  from pytorch_translate.common_layers import Linear
label_desc: Use image node_id 1 to create a new DotAttention object from inherited base classes: BaseAttention with example: obj = DotAttention(decoder_hidden_state_dim, context_dim)