code: def test_encoder(self):
      embedding = torch.rand(5, 50, 7)
      encoder = ClsPooler(embedding_dim=7)
      pooled = encoder(embedding, mask=None)
  
      assert list(pooled.size()) == [5, 7]
      numpy.testing.assert_array_almost_equal(embedding[:, 0], pooled)
  
file_path: allennlp/tests/modules/seq2vec_encoders/cls_pooler_test.py
imports: import numpy
  import torch
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.modules.seq2vec_encoders.cls_pooler import ClsPooler
label_desc: Use image node_id 1 for calling the TestClsPooler obj's underlying member method code with example usage: obj.test_encoder() without return types