Skip to content

Commit 6fd9132

Browse files
committed
removed flux from tests
1 parent 2855c5b commit 6fd9132

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/runtests.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using NNlib, Test, Flux
1+
using NNlib, Test
22

33
@testset "NNlib" begin
44

@@ -32,11 +32,8 @@ xs = Float32[1 2 3; 1000 2000 3000]
3232

3333
@test NNlib.∇logsoftmax(ones(size(xs)), xs) zeros(Float32, size(xs))
3434
@test NNlib.∇softmax(ones(size(xs)), xs) zeros(Float32, size(xs))
35-
gradtest(f, xs::AbstractArray...) = Flux.Tracker.gradcheck((xs...) -> sum(sin.(f(xs...))), xs...)
36-
@test gradtest(logsoftmax, xs)
37-
@test gradtest(softmax, xs)
3835

39-
xs = randn(5, 10)
40-
@test gradtest(logsoftmax, xs)
41-
@test gradtest(softmax, xs)
36+
xs = [-0.238639 0.748142 -0.283194 -0.525461 -1.5348 -0.797842; 0.690384 0.211427 0.254794 -0.213572 -0.314174 -0.372663; -1.14637 -0.577988 0.718952 0.91972 -0.620773 0.929977]
37+
@test isapprox(NNlib.logsoftmax(ones(size(xs)), xs), [0.237703 -0.621474 0.448193 0.546047 0.564185 0.632273; -0.930163 0.0519798 0.0549979 0.3799 -0.477112 0.437428; 0.69246 0.569494 -0.503191 -0.925947 -0.0870738 -1.0697]; rtol = 1e-6)
38+
@test isapprox(NNlib.softmax(ones(size(xs)), xs), zeros(size(xs)); atol = 1e-6)
4239
end

0 commit comments

Comments
 (0)