code: def test_add_sentence_boundary_token_ids_handles_2D_input(self):
      tensor = torch.from_numpy(numpy.array([[1, 2, 3], [4, 5, 0]]))
      mask = (tensor > 0).long()
      bos = 9
      eos = 10
      new_tensor, new_mask = util.add_sentence_boundary_token_ids(
          tensor, mask, bos, eos
      )
      expected_new_tensor = numpy.array(
          [[9, 1, 2, 3, 10], [9, 4, 5, 10, 0]]
      )
      assert (new_tensor.data.numpy() == expected_new_tensor).all()
      assert (new_mask.data.numpy() == (expected_new_tensor > 0)).all()
  
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 31 for calling the TestNnUtil obj's underlying member method code with example usage: obj.test_add_sentence_boundary_token_ids_handles_2D_input() without return types