From a4ea9ba3b1e2b5539f7062bc6c0e4023baf611e6 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 18 Nov 2024 09:28:43 -0100 Subject: [PATCH] Update gradients.jl --- src/gradients.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gradients.jl b/src/gradients.jl index 2c32526..3ec0c94 100644 --- a/src/gradients.jl +++ b/src/gradients.jl @@ -238,7 +238,7 @@ function finite_difference_gradient!( # c1 denotes x1, c2 is epsilon fx, c1, c2, c3 = cache.fx, cache.c1, cache.c2, cache.c3 if fdtype != Val(:complex) && ArrayInterface.fast_scalar_indexing(c2) - @. c2 = compute_epsilon(fdtype, x, relstep, absstep, dir) + @. c2 = compute_epsilon(fdtype, one(eltype(x)), relstep, absstep, dir) copyto!(c1, x) end copyto!(c3, x)