wenet-e2e / wetts

Production First and Production Ready End-to-End Text-to-Speech Toolkit
Apache License 2.0
368 stars 58 forks source link

HIFIGAN 1D to 2D疑问 #136

Closed MarsMeng1994 closed 1 year ago

MarsMeng1994 commented 1 year ago

请问下,为什么hifigan的MPD的1D->2D是这样实现的呀? `def forward(self, x): fmap = []

    # 1d to 2d
    b, c, t = x.shape
    if t % self.period != 0:  # pad first
        n_pad = self.period - (t % self.period)
        x = F.pad(x, (0, n_pad), "reflect")
        t = t + n_pad
    x = x.view(b, c, t // self.period, self.period)

` image 从图上来看,比如【1,2,3,4,5,6】应该变成【【1,3,5】,【2,4,6】】嘛?

robin1001 commented 1 year ago

把那个图倒过来,竖着看,不就是 [[1, 2] [3, 4], [5, 6]]