code: def test_get_text_field_mask_returns_a_correct_mask_character_only_input(
      self,
  ):
      text_field_tensors = {
          "token_characters": torch.LongTensor(
              [
                  [[1, 2, 3], [3, 0, 1], [2, 1, 0], [0, 0, 0]],
                  [[5, 5, 5], [4, 6, 0], [0, 0, 0], [0, 0, 0]],
              ]
          )
      }
      assert_almost_equal(
          util.get_text_field_mask(text_field_tensors).numpy(),
          [[1, 1, 1, 0], [1, 1, 0, 0]],
      )
  
imports: from __future__ import with_statement
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_almost_equal
  import torch
  import pytest
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.nn import util
label_desc: Use image node_id 12 for calling the TestNnUtil obj's underlying member method code with example usage: obj.test_get_text_field_mask_returns_a_correct_mask_character_only_input() without return types