-
-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
When I am trying to check for gradient float preserving tests seperately, it is failing tests:
julia> using Test
julia> using Zygote
julia> using NNlib
julia> typeof(leakyrelu'(Float32(0.5)))
Float64
julia> function test_gradient_float_precision_preserving(a)
@testset "$(a): " begin
for T in [Float32, Float64]
for val in [-10, -1, 0, 1, 10]
val = @inferred a'(T(val))
@test typeof(val) == T
end
end
end
end
test_gradient_float_precision_preserving (generic function with 1 method)
julia> test_gradient_float_precision_preserving(leakyrelu)
leakyrelu: : Test Failed at REPL[5]:6
Expression: typeof(val) == T
Evaluated: Float64 == Float32
Stacktrace:
[1] macro expansion at ./REPL[5]:6 [inlined]
[2] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107 [inlined]
[3] test_gradient_float_precision_preserving(::Function) at ./REPL[5]:3
leakyrelu: : Test Failed at REPL[5]:6
Expression: typeof(val) == T
Evaluated: Float64 == Float32
Stacktrace:
[1] macro expansion at ./REPL[5]:6 [inlined]
[2] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107 [inlined]
[3] test_gradient_float_precision_preserving(::Function) at ./REPL[5]:3
leakyrelu: : Test Failed at REPL[5]:6
Expression: typeof(val) == T
Evaluated: Float64 == Float32
Stacktrace:
[1] macro expansion at ./REPL[5]:6 [inlined]
[2] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107 [inlined]
[3] test_gradient_float_precision_preserving(::Function) at ./REPL[5]:3
leakyrelu: : Test Failed at REPL[5]:6
Expression: typeof(val) == T
Evaluated: Float64 == Float32
Stacktrace:
[1] macro expansion at ./REPL[5]:6 [inlined]
[2] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107 [inlined]
[3] test_gradient_float_precision_preserving(::Function) at ./REPL[5]:3
leakyrelu: : Test Failed at REPL[5]:6
Expression: typeof(val) == T
Evaluated: Float64 == Float32
Stacktrace:
[1] macro expansion at ./REPL[5]:6 [inlined]
[2] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107 [inlined]
[3] test_gradient_float_precision_preserving(::Function) at ./REPL[5]:3
Test Summary: | Pass Fail Total
leakyrelu: | 5 5 10
ERROR: Some tests did not pass: 5 passed, 5 failed, 0 errored, 0 broken.
PS. I understood the reason for this. This might be because of version difference between master branch and released version of NNlib
Metadata
Metadata
Assignees
Labels
No labels