class_docstr: A ``SimilarityFunction`` takes a pair of tensors with the same shape, and computes a similarity
  function on the vectors in the last dimension.  For example, the tensors might both have shape
  `(batch_size, sentence_length, embedding_dim)`, and we will compute some function of the two
  vectors of length `embedding_dim` for each position `(batch_size, sentence_length)`, returning a
  tensor of shape `(batch_size, sentence_length)`.
  
  The similarity function could be as simple as a dot product, or it could be a more complex,
  parameterized function.
  
  If you want to compute a similarity between tensors of different sizes, you need to first tile
  them in the appropriate dimensions to make them the same before you can use these functions.
  The :class:`~allennlp.modules.Attention` and :class:`~allennlp.modules.MatrixAttention` modules
  do this.
class_docstr_tok: ["A","``","SimilarityFunction","``","takes","a","pair","of","tensors","with","the","same","shape",",","and","computes","a","similarity","function","on","the","vectors","in","the","last","dimension",".","For","example",",","the","tensors","might","both","have","shape","`","(","batch_size",",","sentence_length",",","embedding_dim",")","`",",","and","we","will","compute","some","function","of","the","two","vectors","of","length","`","embedding_dim","`","for","each","position","`","(","batch_size",",","sentence_length",")","`",",","returning","a","tensor","of","shape","`","(","batch_size",",","sentence_length",")","`",".","The","similarity","function","could","be","as","simple","as","a","dot","product",",","or","it","could","be","a","more","complex",",","parameterized","function",".","If","you","want","to","compute","a","similarity","between","tensors","of","different","sizes",",","you","need","to","first","tile","them","in","the","appropriate","dimensions","to","make","them","the","same","before","you","can","use","these","functions",".","The",":","class",":","`","~allennlp.modules.Attention","`","and",":","class",":","`","~allennlp.modules.MatrixAttention","`","modules","do","this","."]
docstr: Takes two tensors of the same shape, such as ``(batch_size, length_1, length_2,
  embedding_dim)``.  Computes a (possibly parameterized) similarity on the final dimension
  and returns a tensor with one less dimension, such as ``(batch_size, length_1, length_2)``.
docstr_tok: ["Takes","two","tensors","of","the","same","shape",",","such","as","``","(","batch_size",",","length_1",",","length_2",",","embedding_dim",")","``",".","Computes","a","(","possibly","parameterized",")","similarity","on","the","final","dimension","and","returns","a","tensor","with","one","less","dimension",",","such","as","``","(","batch_size",",","length_1",",","length_2",")","``","."]
code: def forward(self, tensor_1, tensor_2):
      # pylint: disable=arguments-differ
      """
      Takes two tensors of the same shape, such as ``(batch_size, length_1, length_2,
      embedding_dim)``.  Computes a (possibly parameterized) similarity on the final dimension
      and returns a tensor with one less dimension, such as ``(batch_size, length_1, length_2)``.
      """
      raise NotImplementedError
  
imports: from __future__ import absolute_import
  import torch
  from allennlp.common import Registrable
label_desc: Use image node_id 1 for calling the SimilarityFunction obj's underlying member method code with example usage: obj.forward(tensor_1, tensor_2) without return types