docstr: Forward pass of the PriorDecoder module.
  
  Args:
      x (Tensor): Input tensor (B, attention_dim + 2, T).
      x_lengths (Tensor): Length tensor (B,).
      g (Tensor): Tensor for multi-singer. (B, global_channels, 1)
  
  Returns:
      Tensor: Output tensor (B, out_channels, T).
      Tensor: Output mask tensor (B, 1, T).
docstr_tok: ["Forward","pass","of","the","PriorDecoder","module",".","Args",":","x","(","Tensor",")",":","Input","tensor","(","B",",","attention_dim","+","2",",","T",")",".","x_lengths","(","Tensor",")",":","Length","tensor","(","B",",",")",".","g","(","Tensor",")",":","Tensor","for","multi-singer",".","(","B",",","global_channels",",","1",")","Returns",":","Tensor",":","Output","tensor","(","B",",","out_channels",",","T",")",".","Tensor",":","Output","mask","tensor","(","B",",","1",",","T",")","."]
code: def forward(self, x, x_lengths, g=None):
      """
      Forward pass of the PriorDecoder module.
  
      Args:
          x (Tensor): Input tensor (B, attention_dim + 2, T).
          x_lengths (Tensor): Length tensor (B,).
          g (Tensor): Tensor for multi-singer. (B, global_channels, 1)
  
      Returns:
          Tensor: Output tensor (B, out_channels, T).
          Tensor: Output mask tensor (B, 1, T).
      """
  
      x_mask = (
          make_non_pad_mask(x_lengths)
          .to(
              device=x.device,
              dtype=x.dtype,
          )
          .unsqueeze(1)
      )
      x = self.prenet(x) * x_mask
  
      # multi-singer
      if g is not None:
          g = torch.detach(g)
          x = x + self.conv(g)
  
      x = x * x_mask
      x = x.transpose(1, 2)
      x, _ = self.decoder(x, x_mask)
      x = x.transpose(1, 2)
  
      bn = self.proj(x) * x_mask
  
      return bn, x_mask
  
imports: import torch
  from espnet.nets.pytorch_backend.conformer.encoder import Encoder
  from espnet.nets.pytorch_backend.nets_utils import make_non_pad_mask
label_desc: Use image node_id 2 for calling the PriorDecoder obj's underlying member method code with example usage: obj.forward(x, x_lengths, g) and returns: bn,  x_mask