class_docstr: Computes attention between two tensors using scaled dot product.
  # Reference: [Attention Is All You Need (Vaswani et al, 2017)]
  # (https://api.semanticscholar.org/CorpusID:13756489)
  
  Registered as an `Attention` with name "scaled_dot_product".
  
  # Parameters
  
  scaling_factor : `int`, required
      The similarity score is scaled down by the `scaling_factor`.
  normalize : `bool`, optional (default=`True`)
      If true, we normalize the computed similarities with a softmax, to return a probability
      distribution for your attention.  If false, this is just computing a similarity score.
code: def __init__(
      self, scaling_factor: Optional[int] = None, normalize: bool = True
  ) -> None:
      super().__init__(normalize)
      self.scaling_factor = scaling_factor
  
file_path: allennlp/allennlp/modules/attention/scaled_dot_product_attention.py
imports: import math
  from typing import Optional
  import torch
  from allennlp.modules.attention.dot_product_attention import DotProductAttention
  from allennlp.modules.attention.attention import Attention
label_desc: Use image node_id 1 to create a new ScaledDotProductAttention object from inherited base classes: DotProductAttention with example: obj = ScaledDotProductAttention(scaling_factor, normalize)