Skip to content

Commit f5d031e

Browse files
author
Roger-luo
committed
add revert for scalars
1 parent b1da235 commit f5d031e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/grad.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jacobian(fdm, f, x::Vector{<:Real}) = jacobian(fdm, f, x, length(f(x)))
3636

3737
function jacobian(fdm, f, x::Real, D::Int)
3838
x_vec, vec_to_x = to_vec(x)
39-
return jacobian(fdm, f, x_vec, D)
39+
return jacobian(fdm, x->f(vec_to_x(x)), x_vec, D)
4040
end
4141

4242
replace_arg(k, xs::Tuple, x) = (xs[1:k-1]..., x, xs[k+1:end]...)

0 commit comments

Comments
 (0)