class_docstr: Computes attention between a vector and a matrix using a similarity function.
  This should be considered deprecated, as it consumes more memory than the specialized attention modules.
code: def __init__(self, similarity_function=None, normalize=True):
      super(LegacyAttention, self).__init__(normalize)
      self._similarity_function = (
          similarity_function or DotProductSimilarity()
      )
  
file_path: magnitude/pymagnitude/third_party/allennlp/modules/attention/legacy_attention.py
imports: from __future__ import absolute_import
  import torch
  from allennlp.modules.attention.attention import Attention
  from allennlp.modules.similarity_functions import DotProductSimilarity, SimilarityFunction
label_desc: Use image node_id 1 to create a new LegacyAttention object from inherited base classes: Attention with example: obj = LegacyAttention(similarity_function, normalize)