class_docstr: Duration_Encoder module of Spectrogram prediction network.
  
  This is a module of encoder of Spectrogram prediction network in Singing-Tacotron,
  This is the encoder which converts the sequence
  of durations and tempo features into a transition token.
  
  .. _`SINGING-TACOTRON: GLOBAL DURATION CONTROL ATTENTION AND DYNAMIC FILTER FOR
  END-TO-END SINGING VOICE SYNTHESIS`:
     https://arxiv.org/abs/2202.07907
class_docstr_tok: ["Duration_Encoder","module","of","Spectrogram","prediction","network",".","This","is","a","module","of","encoder","of","Spectrogram","prediction","network","in","Singing-Tacotron",",","This","is","the","encoder","which","converts","the","sequence","of","durations","and","tempo","features","into","a","transition","token",".","..","_","`","SINGING-TACOTRON",":","GLOBAL","DURATION","CONTROL","ATTENTION","AND","DYNAMIC","FILTER","FOR","END-TO-END","SINGING","VOICE","SYNTHESIS","`",":","https",":","\/\/arxiv.org\/abs\/2202.07907"]
docstr: Calculate forward propagation.
  
  Args:
      xs (Tensor): Batch of the duration sequence.(B, Tmax, feature_len)
  
  Returns:
      Tensor: Batch of the sequences of transition token (B, Tmax, 1).
      LongTensor: Batch of lengths of each sequence (B,)
docstr_tok: ["Calculate","forward","propagation",".","Args",":","xs","(","Tensor",")",":","Batch","of","the","duration","sequence",".","(","B",",","Tmax",",","feature_len",")","Returns",":","Tensor",":","Batch","of","the","sequences","of","transition","token","(","B",",","Tmax",",","1",")",".","LongTensor",":","Batch","of","lengths","of","each","sequence","(","B",",",")"]
code: def forward(self, xs):
      """Calculate forward propagation.
  
      Args:
          xs (Tensor): Batch of the duration sequence.(B, Tmax, feature_len)
  
      Returns:
          Tensor: Batch of the sequences of transition token (B, Tmax, 1).
          LongTensor: Batch of lengths of each sequence (B,)
  
      """
      xs = self.dense24(xs).transpose(1, 2)
      xs = self.convs(xs).transpose(1, 2)
      xs = self.dense1(xs)
      xs = self.nntanh(xs)
      xs = (xs + 1) / 2
      return xs
  
file_path: espnet/espnet2/svs/singing_tacotron/encoder.py
imports: import torch
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
label_desc: Use image node_id 2 for calling the Duration_Encoder obj's underlying member method code with example usage: obj.forward(xs) and returns: xs