(self,inputs)
| 119 | |
| 120 | |
| 121 | def forward(self,inputs): |
| 122 | if self.padding[1] != 0 and self.causal: |
| 123 | inputs = F.pad(inputs,[self.padding[1], 0,0,0]) |
| 124 | else: |
| 125 | inputs = F.pad(inputs,[self.padding[1], self.padding[1],0,0]) |
| 126 | |
| 127 | if self.complex_axis == 0: |
| 128 | real = self.real_conv(inputs) |
| 129 | imag = self.imag_conv(inputs) |
| 130 | real2real,imag2real = torch.chunk(real,2, self.complex_axis) |
| 131 | real2imag,imag2imag = torch.chunk(imag,2, self.complex_axis) |
| 132 | |
| 133 | else: |
| 134 | if isinstance(inputs, torch.Tensor): |
| 135 | real,imag = torch.chunk(inputs, 2, self.complex_axis) |
| 136 | |
| 137 | real2real = self.real_conv(real,) |
| 138 | imag2imag = self.imag_conv(imag,) |
| 139 | |
| 140 | real2imag = self.imag_conv(real) |
| 141 | imag2real = self.real_conv(imag) |
| 142 | |
| 143 | real = real2real - imag2imag |
| 144 | imag = real2imag + imag2real |
| 145 | out = torch.cat([real, imag], self.complex_axis) |
| 146 | |
| 147 | return out |
| 148 | |
| 149 | class ComplexConvTranspose2d(nn.Module): |
| 150 |
nothing calls this directly
no outgoing calls
no test coverage detected