class_docstr: Class to store batched alignments (logits, labels, frame_confidence).
  Size is different from hypotheses, since blank outputs are preserved
class_docstr_tok: ["Class","to","store","batched","alignments","(","logits",",","labels",",","frame_confidence",")",".","Size","is","different","from","hypotheses",",","since","blank","outputs","are","preserved"]
docstr: Add results (inplace) from a decoding step to the batched hypotheses
  Args:
      active_indices: tensor with indices of active hypotheses (indices should be within the original batch_size)
      logits: tensor with raw network outputs
      labels: tensor with decoded labels (can contain blank)
      time_indices: tensor of time index for each label
      confidence: optional tensor with confidence for each item in batch
docstr_tok: ["Add","results","(","inplace",")","from","a","decoding","step","to","the","batched","hypotheses","Args",":","active_indices",":","tensor","with","indices","of","active","hypotheses","(","indices","should","be","within","the","original","batch_size",")","logits",":","tensor","with","raw","network","outputs","labels",":","tensor","with","decoded","labels","(","can","contain","blank",")","time_indices",":","tensor","of","time","index","for","each","label","confidence",":","optional","tensor","with","confidence","for","each","item","in","batch"]
code: def add_results_(
      self,
      active_indices: torch.Tensor,
      time_indices: torch.Tensor,
      logits: Optional[torch.Tensor] = None,
      labels: Optional[torch.Tensor] = None,
      confidence: Optional[torch.Tensor] = None,
  ):
      """
      Add results (inplace) from a decoding step to the batched hypotheses
      Args:
          active_indices: tensor with indices of active hypotheses (indices should be within the original batch_size)
          logits: tensor with raw network outputs
          labels: tensor with decoded labels (can contain blank)
          time_indices: tensor of time index for each label
          confidence: optional tensor with confidence for each item in batch
      """
      # we assume that all tensors have the same first dimension
      if active_indices.shape[0] == 0:
          return  # nothing to add
  
      # if needed - increase storage
      if self.current_lengths.max().item() >= self._max_length:
          self._allocate_more()
  
      active_lengths = self.current_lengths[active_indices]
      # store timesteps - same for alignments / confidence
      self.timesteps[active_indices, active_lengths] = time_indices
  
      if (
          self.with_alignments
          and logits is not None
          and labels is not None
      ):
          self.logits[active_indices, active_lengths] = logits
          self.labels[active_indices, active_lengths] = labels
  
      if self.with_frame_confidence and confidence is not None:
          self.frame_confidence[
              active_indices, active_lengths
          ] = confidence
      # increase lengths
      self.current_lengths[active_indices] += 1
  
file_path: NeMo/nemo/collections/asr/parts/utils/rnnt_utils.py
imports: from dataclasses import dataclass, field
  from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
label_desc: Use image node_id 3 for calling the BatchedAlignments obj's underlying member method code with example usage: obj.add_results_(active_indices, time_indices, logits, labels, confidence) without return types