code: def test_bidaf_trilinear_similarity(self):
      linear = LinearAttention(
          2, 2, combination="x,y,x*y", normalize=False
      )
      linear._weight_vector = Parameter(
          torch.FloatTensor([-0.3, 0.5, 2.0, -1.0, 1, 1])
      )
      linear._bias = Parameter(torch.FloatTensor([0.0]))
      output = linear(
          torch.FloatTensor([[4, 5]]),
          torch.FloatTensor([[[1, 2], [4, 5], [7, 8], [10, 11]]]),
      )
  
      assert_almost_equal(
          output.data.numpy(),
          numpy.array(
              [
                  [
                      -1.2 + 2.5 + 2 + -2 + 4 + 10,
                      -1.2 + 2.5 + 8 + -5 + 16 + 25,
                      -1.2 + 2.5 + 14 + -8 + 28 + 40,
                      -1.2 + 2.5 + 20 + -11 + 40 + 55,
                  ]
              ]
          ),
          decimal=2,
      )
  
file_path: allennlp/tests/modules/attention/linear_attention_test.py
imports: from numpy.testing import assert_almost_equal
  import numpy
  import torch
  from torch.autograd import Variable
  from torch.nn import Parameter
  from allennlp.common import Params
  from allennlp.common.testing.test_case import AllenNlpTestCase
  from allennlp.modules.attention import LinearAttention
  from allennlp.modules.attention.attention import Attention
label_desc: Use image node_id 3 for calling the LinearAttentionTest obj's underlying member method code with example usage: obj.test_bidaf_trilinear_similarity() without return types