Skip to content

Commit

Permalink
Add tests for complex float promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-arya committed Mar 6, 2023
1 parent 20de5e7 commit 3cbb2bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ end
end
end

@testset "Complex float promotion for backwards real FFTs" begin
for x in (rand(-5:5, 3), rand(-5:5, 3, 4), rand(-5:5, 3, 4, 5))
N = ndims(x)
complex_x = complex.(x)
d = 2 * size(x, 1) - 1
@test irfft(x, d) irfft(complex.(x), d) irfft(complex.(float.(x)), d)
@test brfft(x, d) brfft(complex.(x), d) brfft(complex.(float.(x)), d)
end
end

@testset "ChainRules" begin
@testset "shift functions" begin
for x in (randn(3), randn(3, 4), randn(3, 4, 5))
Expand Down

0 comments on commit 3cbb2bb

Please sign in to comment.