class_docstr: TCN (Temporal Convolution Network) Separation Module
  
  Generates masks for separation.
  
  Args:
      input_dim (int): Input feature dimension, <N>.
      num_sources (int): The number of sources to separate.
      kernel_size (int): The convolution kernel size of conv blocks, <P>.
      num_featrs (int): Input/output feature dimenstion of conv blocks, <B, Sc>.
      num_hidden (int): Intermediate feature dimention of conv blocks, <H>
      num_layers (int): The number of conv blocks in one stack, <X>.
      num_stacks (int): The number of conv block stacks, <R>.
      msk_activate (str): The activation function of the mask output.
  
  Note:
      This implementation corresponds to the "non-causal" setting in the paper.
docstr: Generate separation mask.
  
  Args:
      input (torch.Tensor): 3D Tensor with shape [batch, features, frames]
  
  Returns:
      Tensor: shape [batch, num_sources, features, frames]
docstr_tok: ["Generate","separation","mask",".","Args",":","input","(","torch.Tensor",")",":","3D","Tensor","with","shape","[","batch",",","features",",","frames","]","Returns",":","Tensor",":","shape","[","batch",",","num_sources",",","features",",","frames","]"]
code: def forward(self, input: torch.Tensor) -> torch.Tensor:
      """Generate separation mask.
  
      Args:
          input (torch.Tensor): 3D Tensor with shape [batch, features, frames]
  
      Returns:
          Tensor: shape [batch, num_sources, features, frames]
      """
      batch_size = input.shape[0]
      feats = self.input_norm(input)
      feats = self.input_conv(feats)
      output = 0.0
      for layer in self.conv_layers:
          residual, skip = layer(feats)
          if (
              residual is not None
          ):  # the last conv layer does not produce residual
              feats = feats + residual
          output = output + skip
      output = self.output_prelu(output)
      output = self.output_conv(output)
      output = self.mask_activate(output)
      return output.view(
          batch_size, self.num_sources, self.input_dim, -1
      )
  
file_path: audio/src/torchaudio/models/conv_tasnet.py
imports: from typing import Optional, Tuple
  import torch
label_desc: Use image node_id 2 for calling the MaskGenerator obj's underlying member method code with example usage: obj.forward(input) and returns: output