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 _forward_internal(self, vector, matrix):
      tiled_vector = vector.unsqueeze(1).expand(
          vector.size()[0], matrix.size()[1], vector.size()[1]
      )
      return self._similarity_function(tiled_vector, matrix)
  
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 2 for calling the LegacyAttention obj's underlying member method code with example usage: obj._forward_internal(vector, matrix) and returns: self