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.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 encoder forward pass
      with torch.no_grad():
          ASR_encoder_out = self.hparams.asr_model.encode_batch(
              wavs.detach(), wav_lens
          )
  
      # SLU forward pass
      encoder_out = self.hparams.slu_enc(ASR_encoder_out)
      e_in = self.hparams.output_emb(tokens_bos)
      h, _ = self.hparams.dec(e_in, encoder_out, wav_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, wav_lens
          )
  
      return p_seq, wav_lens, p_tokens
  
file_path: speechbrain/recipes/fluent-speech-commands/direct/train.py
imports: import sys
  import torch
  import speechbrain
  import logging
  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,  wav_lens,  p_tokens