code: def test_zeros_out_unknown_tokens(self):
      embedder = BagOfWordCountsTokenEmbedder(
          self.vocab, ignore_oov=True
      )
      numpy_tensor = np.array([[1, 5], [2, 0], [4, 4]])
      inputs = torch.from_numpy(numpy_tensor)
      embedder_output = embedder(inputs)
      numpy_tensor = np.array(
          [[0, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 2, 0]]
      )
      manual_output = torch.from_numpy(numpy_tensor).float()
      assert_almost_equal(
          embedder_output.data.numpy(), manual_output.data.numpy()
      )
  
file_path: allennlp/tests/modules/token_embedders/bag_of_word_counts_token_embedder_test.py
imports: import numpy
  import pytest
  import torch
  from numpy.testing import assert_almost_equal
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Vocabulary
  from allennlp.modules.token_embedders import BagOfWordCountsTokenEmbedder
label_desc: Use image node_id 3 for calling the TestBagOfWordCountsTokenEmbedder obj's underlying member method code with example usage: obj.test_zeros_out_unknown_tokens() without return types