Skip to content

Commit 7fdff81

Browse files
committed
Try #782:
2 parents 8ee6af1 + 8c6ef20 commit 7fdff81

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Manifest.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ version = "0.5.3"
272272

273273
[[Tracker]]
274274
deps = ["Adapt", "DiffRules", "ForwardDiff", "LinearAlgebra", "MacroTools", "NNlib", "NaNMath", "Printf", "Random", "Requires", "SpecialFunctions", "Statistics", "Test"]
275-
git-tree-sha1 = "0bec1b68c63a0e8a58d3944261cbf4cc9577c8a1"
275+
git-tree-sha1 = "2e516162af7f1e208b62ef3da3af0d094a44aab1"
276+
repo-rev = "9c2c05ec6d785996d83f7f59e3209461fcc36c01"
277+
repo-url = "https://github.com/FluxML/Tracker.jl.git"
276278
uuid = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
277-
version = "0.2.0"
279+
version = "0.2.2"
278280

279281
[[TranscodingStreams]]
280282
deps = ["Random", "Test"]

test/cuda/cuda.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ end
4848
@test y[3,:] isa CuArray
4949
end
5050

51+
@testset "Jacobian on GPU" begin
52+
# https://github.com/FluxML/Tracker.jl/pull/33
53+
@test collect(jacobian(identity, gpu([0.0, 0.0]))) == [1 0; 0 1]
54+
@test collect(gradient(x -> sum(jacobian(y -> y .^ 2, x) .^ 2),
55+
gpu([1.0, 2.0, 3.0]))) == [8.0, 16.0, 24.0]
56+
end
57+
5158
if CuArrays.libcudnn != nothing
5259
@info "Testing Flux/CUDNN"
5360
include("cudnn.jl")

0 commit comments

Comments
 (0)