File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change 7
7
end
8
8
9
9
@testset " forward diff" begin
10
- f = (x) -> logσ .(x)
11
- ds = Dual .(rand (5 ),1 )
12
- @test f (ds) ≈ collect (f (CuArray (ds)))
13
- f = (x) -> tanh .(x)
14
- ds = Dual .(rand (5 ),1 )
15
- @test f (ds) ≈ collect (f (CuArray (ds)))
16
- f = (x) -> σ .(x)
17
- ds = Dual .(rand (5 ),1 )
18
- @test f (ds) ≈ collect (f (CuArray (ds)))
19
- f = (x) -> elu .(x)
20
- ds = Dual .(rand (5 ),1 )
21
- @test f (ds) ≈ collect (f (CuArray (ds)))
22
- f = (x) -> relu .(x)
23
- ds = Dual .(rand (5 ),1 )
24
- @test f (ds) ≈ collect (f (CuArray (ds)))
10
+ for f in NNlib. ACTIVATIONS
11
+ if f ∉ [:rrelu ]
12
+ @eval gputest (x -> $ f .(x), Dual .(rand (5 ), 1 ))
13
+ end
14
+ end
25
15
end
26
16
17
+ # Broadcasting over complex CuArray works without NNlibCUDA, this test checks that
18
+ # NNlibCUDA does not cause such operations to take a fast path which does not support
19
+ # complex numbers (e.g. CUDNN)
27
20
@testset " complex" begin
28
21
f (x) = tanh .(x)
29
22
cs = rand (ComplexF64, 5 )
You can’t perform that action at this time.
0 commit comments