code: def compute_with_pytorch_transducer(data):
      fused_log_softmax = data.get("fused_log_softmax", True)
      input = data["logits"]
      if not fused_log_softmax:
          input = torch.nn.functional.log_softmax(input, dim=-1)
  
      costs = rnnt_loss(
          logits=input,
          logit_lengths=data["logit_lengths"],
          target_lengths=data["target_lengths"],
          targets=data["targets"],
          blank=data["blank"],
          reduction="none",
          fused_log_softmax=fused_log_softmax,
      )
  
      loss = torch.sum(costs)
      loss.backward()
      costs = costs.cpu()
      gradients = data["logits"].saved_grad.cpu()
      return costs, gradients
  
imports: import random
  import unittest
  import numpy
  import torch
  from torchaudio.functional import rnnt_loss
label_desc: Use image node_id 2 for calling a global function with example usage: compute_with_pytorch_transducer(data) and returns: costs,  gradients