docstr: Given an input batch it computes the two estimated sources.
docstr_tok: ["Given","an","input","batch","it","computes","the","two","estimated","sources","."]
code: def compute_forward(self, mixture, stage):
      "Given an input batch it computes the two estimated sources."
      mixture = mixture.to(self.device)
      mix_w = self.hparams.encoder(mixture)
      est_mask = self.hparams.mask_net(mix_w)
      mix_w = torch.stack([mix_w] * 2)
      sep_h = mix_w * est_mask
  
      # Decoding
      est_source = torch.cat(
          [
              self.hparams.decoder(sep_h[i]).unsqueeze(-1)
              for i in range(2)
          ],
          dim=-1,
      )
  
      # T changed after conv1d in encoder, fix it here
      T_origin = mixture.size(1)
      T_conv = est_source.size(1)
      if T_origin > T_conv:
          est_source = F.pad(est_source, (0, 0, 0, T_origin - T_conv))
      else:
          est_source = est_source[:, :T_origin, :]
  
      return est_source
  
file_path: speechbrain/tests/integration/separation/example_conv_tasnet.py
imports: import torch
  import pathlib
  import speechbrain
  import torch.nn.functional
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.nnet.losses import get_si_snr_with_pitwrapper
label_desc: Use image node_id 1 for calling the SepBrain obj's underlying member method code with example usage: obj.compute_forward(mixture, stage) and returns: est_source