code: def test_scatter_all_embeddings_multi_batch(self):
      glue_model = GlueModelForTesting(
          model_name_or_path="bert-base-uncased",
          text_a_name="sentence1",
      )
      emb_size = 4
      embs_a = np.zeros((1, emb_size))
      embs_b = np.zeros((2, emb_size))
      input_embs = np.ones((2, 4, emb_size))
      # Scatter embs_a and embs_b into input_embs
      result = glue_model.scatter_all_embeddings(
          [
              {
                  "sentence1": "hi",
                  "input_embs_sentence1": embs_a,
              },
              {
                  "sentence1": "hi there",
                  "input_embs_sentence1": embs_b,
              },
          ],
          input_embs,
      )
      target = [
          [[1, 1, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 1]],
          [[1, 1, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1]],
      ]
      np.testing.assert_almost_equal(result, target)
  
      # Scatter only embs_a into input_embs
      result = glue_model.scatter_all_embeddings(
          [
              {
                  "sentence1": "hi",
                  "input_embs_sentence1": embs_a,
              },
              {"sentence1": "hi there"},
          ],
          input_embs,
      )
      target = [
          [[1, 1, 1, 1], [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 1]],
          [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
      ]
      np.testing.assert_almost_equal(result, target)
  
      # Scatter only embs_b into input_embs
      result = glue_model.scatter_all_embeddings(
          [
              {"sentence1": "hi"},
              {
                  "sentence1": "hi there",
                  "input_embs_sentence1": embs_b,
              },
          ],
          input_embs,
      )
      target = [
          [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
          [[1, 1, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0], [1, 1, 1, 1]],
      ]
      np.testing.assert_almost_equal(result, target)
  
file_path: lit/lit_nlp/examples/models/glue_models_test.py
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import attr
  from lit_nlp.examples.models import glue_models
  import numpy
label_desc: Use image node_id 4 for calling the GlueModelsTest obj's underlying member method code with example usage: obj.test_scatter_all_embeddings_multi_batch() without return types