code: def test_can_construct_from_params(self):
      params = Params(
          {
              "embedding_dim": 5,
          }
      )
      encoder = BagOfEmbeddingsEncoder.from_params(params)
      assert encoder.get_input_dim() == 5
      assert encoder.get_output_dim() == 5
      params = Params({"embedding_dim": 12, "averaged": True})
      encoder = BagOfEmbeddingsEncoder.from_params(params)
      assert encoder.get_input_dim() == 12
      assert encoder.get_output_dim() == 12
  
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 2 for calling the TestBagOfEmbeddingsEncoder obj's underlying member method code with example usage: obj.test_can_construct_from_params() without return types