From b557ffea650822220523a2a3fbdbd6671b161027 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 27 Aug 2019 15:16:40 -0400 Subject: [PATCH] CuArray-compatible Jacobians No color vectors --- src/back.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/back.jl b/src/back.jl index e638e1ad..e5acb9c5 100644 --- a/src/back.jl +++ b/src/back.jl @@ -173,7 +173,7 @@ Calculate the output jacobian `J = d/dx m(x)` such that each row `i` of `J` corr """ function jacobian(f, x::AbstractVector) y::AbstractVector, back = forward(f, x) - ȳ(i) = [i == j for j = 1:length(y)] + ȳ(i) = false .* y .+ (1:length(y) .== i) vcat([transpose(back(ȳ(i))[1]) for i = 1:length(y)]...) end