|
5 | 5 |
|
6 | 6 | ft = FourierTransform((3, 4, 5))
|
7 | 7 |
|
8 |
| - @test size(transform(ft, 𝐱)) == (30, 40, 50, ch, batch) |
| 8 | + @test size(transform(ft, 𝐱)) == (16, 40, 50, ch, batch) |
9 | 9 | @test size(truncate_modes(ft, transform(ft, 𝐱))) == (3, 4, 5, ch, batch)
|
10 |
| - @test size(inverse(ft, truncate_modes(ft, transform(ft, 𝐱)))) == (3, 4, 5, ch, batch) |
| 10 | + @test size(inverse(ft, |
| 11 | + NeuralOperators.pad_modes(truncate_modes(ft, transform(ft, 𝐱)), |
| 12 | + size(transform(ft, 𝐱))), |
| 13 | + size(𝐱))) == (30, 40, 50, ch, batch) |
11 | 14 |
|
12 |
| - g = Zygote.gradient(x -> sum(inverse(ft, truncate_modes(ft, transform(ft, x)))), 𝐱) |
| 15 | + g = Zygote.gradient(x -> sum(inverse(ft, |
| 16 | + NeuralOperators.pad_modes(truncate_modes(ft, |
| 17 | + transform(ft, |
| 18 | + x)), |
| 19 | + (16, 40, 50, ch, batch)), |
| 20 | + (30, 40, 50, ch, batch))), 𝐱) |
13 | 21 | @test size(g[1]) == (30, 40, 50, ch, batch)
|
14 | 22 | end
|
0 commit comments