docstr: 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.sig
      tokens_bos, tokens_bos_lens = batch.tokens_bos
  
      # Add waveform augmentation if specified.
      if stage == sb.Stage.TRAIN and hasattr(
          self.hparams, "wav_augment"
      ):
          wavs, wav_lens = self.hparams.wav_augment(wavs, wav_lens)
          tokens_bos = self.hparams.wav_augment.replicate_labels(
              tokens_bos
          )
          tokens_bos_lens = self.hparams.wav_augment.replicate_labels(
              tokens_bos_lens
          )
  
      # ASR forward pass
      words, asr_tokens = self.hparams.asr_model.transcribe_batch(
          wavs.detach(), wav_lens
      )
  
      # Pad examples to have same length.
      asr_tokens_lens = torch.tensor(
          [max(len(t), 1) for t in asr_tokens]
      )
      max_length = asr_tokens_lens.max().item()
      for t in asr_tokens:
          t += [0] * (max_length - len(t))
      asr_tokens = torch.tensor([t for t in asr_tokens])
  
      asr_tokens_lens = asr_tokens_lens.float()
      asr_tokens_lens = asr_tokens_lens / asr_tokens_lens.max()
  
      asr_tokens, asr_tokens_lens = (
          asr_tokens.to(self.device),
          asr_tokens_lens.to(self.device),
      )
      embedded_transcripts = self.hparams.input_emb(asr_tokens)
  
      # SLU forward pass
      encoder_out = self.hparams.slu_enc(embedded_transcripts)
      e_in = self.hparams.output_emb(tokens_bos)
      h, _ = self.hparams.dec(e_in, encoder_out, asr_tokens_lens)
  
      # Output layer for seq2seq log-probabilities
      logits = self.hparams.seq_lin(h)
      p_seq = self.hparams.log_softmax(logits)
  
      # Compute outputs
      p_tokens = None
      if stage != sb.Stage.TRAIN:
          p_tokens, _, _, _ = self.hparams.beam_searcher(
              encoder_out, asr_tokens_lens
          )
  
      return p_seq, asr_tokens_lens, p_tokens
  
file_path: speechbrain/recipes/timers-and-such/multistage/train.py
imports: import sys
  import torch
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.distributed import run_on_main, if_main_process
label_desc: Use image node_id 1 for calling the SLU obj's underlying member method code with example usage: obj.compute_forward(batch, stage) and returns: p_seq,  asr_tokens_lens,  p_tokens