:param x: [B, T, H] :return: [B, T, H]
(self, x, return_hiddens=False)
| 96 | self.out_proj = Linear(n_chans, odim) |
| 97 | |
| 98 | def forward(self, x, return_hiddens=False): |
| 99 | """ |
| 100 | |
| 101 | :param x: [B, T, H] |
| 102 | :return: [B, T, H] |
| 103 | """ |
| 104 | x = self.in_proj(x) |
| 105 | x = x.transpose(1, -1) # (B, idim, Tmax) |
| 106 | hiddens = [] |
| 107 | for f in self.conv: |
| 108 | x_ = f(x) |
| 109 | x = x + x_ if self.res else x_ # (B, C, Tmax) |
| 110 | hiddens.append(x) |
| 111 | x = x.transpose(1, -1) |
| 112 | x = self.out_proj(x) # (B, Tmax, H) |
| 113 | if return_hiddens: |
| 114 | hiddens = torch.stack(hiddens, 1) # [B, L, C, T] |
| 115 | return x, hiddens |
| 116 | return x |
| 117 | |
| 118 | |
| 119 | class PitchExtractor(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected