docstr: Forward computations from the waveform batches to the output probabilities.
docstr_tok: ["Forward","computations","from","the","waveform","batches","to","the","output","probabilities","."]
code: def compute_forward(self, batch, stage):
      """Forward computations from the waveform batches to the output probabilities."""
  
      batch = batch.to(self.device)
      wavs, wav_lens = batch.clean_sig
      bos_tokens, bos_tokens_lens = batch.tokens_bos
  
      predictions, clean = self.compute_forward_enhance(batch, stage)
  
      # Enhanced signal is to be fed into ASR
      wavs = predictions[0]
  
      # We compute the padding mask and replace the values with the pad_token_id
      # that the Whisper decoder expect to see.
      abs_tokens_lens = (bos_tokens_lens * bos_tokens.shape[1]).long()
      pad_mask = (
          torch.arange(abs_tokens_lens.max(), device=self.device)[
              None, :
          ]
          < abs_tokens_lens[:, None]
      )
      bos_tokens[~pad_mask] = self.tokenizer.pad_token_id
  
      # Forward encoder + decoder
      enc_out, logits, _ = self.modules.whisper(wavs, bos_tokens)
  
      log_probs = self.hparams.log_softmax(logits)
  
      hyps = None
      if stage == sb.Stage.VALID:
          hyps, _, _, _ = self.hparams.valid_greedy_searcher(
              enc_out, wav_lens
          )
      elif stage == sb.Stage.TEST:
          hyps, _, _, _ = self.hparams.test_beam_searcher(
              enc_out, wav_lens
          )
  
      return predictions, clean, [log_probs, hyps, wav_lens]
  
imports: import os
  import sys
  import csv
  import logging
  import numpy
  from tqdm import tqdm
  from pesq import pesq
  from pystoi import stoi
  import torch
  import torchaudio
  import torch.nn.functional
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.metric_stats import MetricStats
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.utils.data_utils import undo_padding
label_desc: Use image node_id 1 for calling the ASR obj's underlying member method code with example usage: obj.compute_forward(batch, stage) and returns: predictions,  clean,  list