code: def test_add_multiple_results(self, device: torch.device):
      # batch of size 2, add label for first utterance
      batch_size = 2
      seq_length = 5
      logits_dim = 7
      alignments = BatchedAlignments(
          batch_size=batch_size,
          logits_dim=logits_dim,
          init_length=1,
          device=device,
      )
      sample_logits = torch.rand(
          (batch_size, seq_length, logits_dim), device=device
      )
      add_logits_mask = (
          torch.rand((batch_size, seq_length), device=device) < 0.6
      )
      for t in range(seq_length):
          alignments.add_results_(
              active_indices=torch.arange(batch_size, device=device)[
                  add_logits_mask[:, t]
              ],
              logits=sample_logits[add_logits_mask[:, t], t],
              labels=torch.argmax(
                  sample_logits[add_logits_mask[:, t], t], dim=-1
              ),
              time_indices=torch.tensor([0, 0], device=device)[
                  add_logits_mask[:, t]
              ],
          )
  
      assert (
          alignments.current_lengths == add_logits_mask.sum(dim=-1)
      ).all()
      for i in range(batch_size):
          assert (
              alignments.logits[i, : alignments.current_lengths[i]]
              == sample_logits[i, add_logits_mask[i]]
          ).all()
  
imports: from typing import List
  import pytest
  import torch
  from nemo.collections.asr.parts.utils.rnnt_utils import BatchedAlignments, BatchedHyps, batched_hyps_to_hypotheses
label_desc: Use image node_id 5 for calling the TestBatchedAlignments obj's underlying member method code with example usage: obj.test_add_multiple_results(device) without return types