code: def test_forward_does_correct_computation(self):
      encoder = BagOfEmbeddingsEncoder(embedding_dim=2)
      input_tensor = torch.FloatTensor(
          [
              [[0.7, 0.8], [0.1, 1.5], [0.3, 0.6]],
              [[0.5, 0.3], [1.4, 1.1], [0.3, 0.9]],
          ]
      )
      mask = torch.ByteTensor([[1, 1, 1], [1, 1, 0]])
      encoder_output = encoder(input_tensor, mask)
      assert_almost_equal(
          encoder_output.data.numpy(),
          numpy.asarray(
              [
                  [0.7 + 0.1 + 0.3, 0.8 + 1.5 + 0.6],
                  [0.5 + 1.4, 0.3 + 1.1],
              ]
          ),
      )
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/modules/seq2vec_encoders/boe_encoder_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  import numpy
  from numpy.testing import assert_almost_equal
  import torch
  from allennlp.common import Params
  from allennlp.modules.seq2vec_encoders import BagOfEmbeddingsEncoder
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 3 for calling the TestBagOfEmbeddingsEncoder obj's underlying member method code with example usage: obj.test_forward_does_correct_computation() without return types