Skip to content

Commit d651024

Browse files
committed
Tests
1 parent cb30e19 commit d651024

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/activations.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,14 @@ end
9393
@testset "Array input -> error" begin
9494
x = rand(5)
9595
for a in ACTIVATION_FUNCTIONS
96-
@test_throws ErrorException a(x)
96+
@test size(a(x)) == size(x)
97+
grad = Zygote.gradient(p -> sum(a(p)), x)
98+
@test size(grad[1]) == size(x)
9799
end
98100
for a in BINARY_ACTIVATIONS
99-
@test_throws ErrorException a(x, 0.1)
101+
@test size(a(x, 0.1)) == size(x)
102+
grad = Zygote.gradient(p -> sum(a(p, 0.1)), x)
103+
@test size(grad[1]) == size(x)
100104
end
101105
end
102106

0 commit comments

Comments
 (0)