:param xs: [B, T, H] :return: [B, T, H]
(self, xs)
| 220 | self.pos_embed_alpha = nn.Parameter(torch.Tensor([1])) |
| 221 | |
| 222 | def forward(self, xs): |
| 223 | """ |
| 224 | |
| 225 | :param xs: [B, T, H] |
| 226 | :return: [B, T, H] |
| 227 | """ |
| 228 | positions = self.pos_embed_alpha * self.embed_positions(xs[..., 0]) |
| 229 | xs = xs + positions |
| 230 | xs = xs.transpose(1, -1) # (B, idim, Tmax) |
| 231 | for f in self.conv: |
| 232 | xs = f(xs) # (B, C, Tmax) |
| 233 | # NOTE: calculate in log domain |
| 234 | xs = self.linear(xs.transpose(1, -1)) # (B, Tmax, H) |
| 235 | return xs |
| 236 | |
| 237 | |
| 238 | class EnergyPredictor(PitchPredictor): |
nothing calls this directly
no outgoing calls
no test coverage detected