code: def test_forward_works_on_higher_order_input(self):
      params = Params(
          {
              "words": {
                  "type": "embedding",
                  "num_embeddings": 20,
                  "embedding_dim": 2,
              },
              "characters": {
                  "type": "character_encoding",
                  "embedding": {
                      "embedding_dim": 4,
                      "num_embeddings": 15,
                  },
                  "encoder": {
                      "type": "cnn",
                      "embedding_dim": 4,
                      "num_filters": 10,
                      "ngram_filter_sizes": [3],
                  },
              },
          }
      )
      token_embedder = BasicTextFieldEmbedder.from_params(
          vocab=self.vocab, params=params
      )
      inputs = {
          "words": (torch.rand(3, 4, 5, 6) * 20).long(),
          "characters": (torch.rand(3, 4, 5, 6, 7) * 15).long(),
      }
      assert token_embedder(inputs, num_wrapping_dims=2).size() == (
          3,
          4,
          5,
          6,
          12,
      )
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/modules/text_field_embedders/basic_text_field_embedder_test.py
imports: from __future__ import division
  from __future__ import with_statement
  from __future__ import absolute_import
  import pytest
  import torch
  from allennlp.common import Params
  from allennlp.common.checks import ConfigurationError
  from allennlp.data import Vocabulary
  from allennlp.modules.text_field_embedders import BasicTextFieldEmbedder
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 5 for calling the TestBasicTextFieldEmbedder obj's underlying member method code with example usage: obj.test_forward_works_on_higher_order_input() without return types