Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
11 changes: 11 additions & 0 deletions test/cuda/cuda.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Flux, Flux.Tracker, CuArrays, Test
using Flux: gpu
using CuArrays: @allowscalar

@info "Testing GPU Support"

Expand Down Expand Up @@ -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")
Expand Down