diff --git a/Manifest.toml b/Manifest.toml index 8f2f0fadf8..ac0a9ef6a4 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -272,9 +272,11 @@ version = "0.5.3" [[Tracker]] deps = ["Adapt", "DiffRules", "ForwardDiff", "LinearAlgebra", "MacroTools", "NNlib", "NaNMath", "Printf", "Random", "Requires", "SpecialFunctions", "Statistics", "Test"] -git-tree-sha1 = "0bec1b68c63a0e8a58d3944261cbf4cc9577c8a1" +git-tree-sha1 = "2b1ff1239e747816e9fb858a38f671ef794b2b2d" +repo-rev = "f6b0ad40a196059b50fd95045b97607ae82b0232" +repo-url = "https://github.com/FluxML/Tracker.jl.git" uuid = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" -version = "0.2.0" +version = "0.2.2" [[TranscodingStreams]] deps = ["Random", "Test"] diff --git a/test/cuda/cuda.jl b/test/cuda/cuda.jl index 96d04c284b..7b866015aa 100644 --- a/test/cuda/cuda.jl +++ b/test/cuda/cuda.jl @@ -1,5 +1,6 @@ using Flux, Flux.Tracker, CuArrays, Test using Flux: gpu +using CuArrays: @allowscalar @info "Testing GPU Support" @@ -48,6 +49,16 @@ end @test y[3,:] isa CuArray end +@testset "Jacobian on GPU" begin + # https://github.com/FluxML/Tracker.jl/pull/33 + @test collect(@allowscalar jacobian(identity, gpu([0.0, 0.0]))) == [1 0; 0 1] + @test collect(@allowscalar jacobian(softmax, gpu(ones(2)))) == + [0.25 -0.25; -0.25 0.25] + @test collect(@allowscalar gradient(x -> sum(jacobian(y -> y .^ 2, x) .^ 2), + gpu([1.0, 2.0, 3.0]))[1]) == + [8.0, 16.0, 24.0] +end + if CuArrays.libcudnn != nothing @info "Testing Flux/CUDNN" include("cudnn.jl")