code: def compute(
      log_probs,
      logit_lengths,
      target_lengths,
      targets,
      blank=-1,
  ):
      gradients = np.zeros_like(log_probs)
      B_tgt, max_T, max_U, D = log_probs.shape
      B_src = logit_lengths.shape[0]
  
      H = int(B_tgt / B_src)
  
      alphas = np.zeros((B_tgt, max_T, max_U))
      betas = np.zeros((B_tgt, max_T, max_U))
      betas.fill(float("-inf"))
      alphas.fill(float("-inf"))
      costs = np.zeros(B_tgt)
      for b_tgt in range(B_tgt):
          b_src = int(b_tgt / H)
          T = int(logit_lengths[b_src])
          # NOTE: see https://arxiv.org/pdf/1211.3711.pdf Section 2.1
          U = int(target_lengths[b_tgt]) + 1
  
          seq_log_probs = log_probs[b_tgt, :T, :U, :]
          seq_targets = targets[b_tgt, : int(target_lengths[b_tgt])]
          alpha, alpha_cost = __class__.compute_alpha_one_sequence(
              log_probs=seq_log_probs, targets=seq_targets, blank=blank
          )
  
          beta, beta_cost = __class__.compute_beta_one_sequence(
              log_probs=seq_log_probs, targets=seq_targets, blank=blank
          )
  
          seq_gradients = __class__.compute_gradients_one_sequence(
              log_probs=seq_log_probs,
              alpha=alpha,
              beta=beta,
              targets=seq_targets,
              blank=blank,
          )
          np.testing.assert_almost_equal(
              alpha_cost, beta_cost, decimal=2
          )
          gradients[b_tgt, :T, :U, :] = seq_gradients
          costs[b_tgt] = beta_cost
          alphas[b_tgt, :T, :U] = alpha
          betas[b_tgt, :T, :U] = beta
  
      return gradients, costs, alphas, betas
  
imports: import random
  import unittest
  import numpy
  import torch
  from torchaudio.functional import rnnt_loss
label_desc: Use image node_id 6 for calling the _NumpyTransducer obj's underlying member method code with example usage: obj.compute(log_probs, logit_lengths, target_lengths, targets, blank) and returns: gradients,  costs,  alphas,  betas