code: def test_add_results(self, device: torch.device):
      # batch of size 2, add label for first utterance
      batch_size = 2
      logits_dim = 7
      sample_logits = torch.rand(
          (batch_size, 1, logits_dim), device=device
      )
      alignments = BatchedAlignments(
          batch_size=batch_size,
          logits_dim=logits_dim,
          init_length=1,
          device=device,
      )
      alignments.add_results_(
          active_indices=torch.arange(batch_size, device=device),
          logits=sample_logits[:, 0],
          labels=torch.argmax(sample_logits[:, 0], dim=-1),
          time_indices=torch.tensor([0, 0], device=device),
      )
      assert alignments.current_lengths.tolist() == [1, 1]
      assert torch.allclose(
          alignments.logits[:, 0], sample_logits[:, 0]
      )
      assert alignments.timesteps[:, 0].tolist() == [0, 0]
  
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 4 for calling the TestBatchedAlignments obj's underlying member method code with example usage: obj.test_add_results(device) without return types