Skip to content

Commit 26431a3

Browse files
committed
methods: assume that f argument of estimate_step is a function-like object instead of a container
This means not relying on eltype.
1 parent 33a4af7 commit 26431a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/methods.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ function estimate_step(
371371
step, acc = withUnit.(
372372
(
373373
unit(x),
374-
unit(f |> eltype) / unit(x) ^ Q
374+
unit(first(f(x))) / unit(x) ^ Q
375375
),
376-
if ∇f_magnitude == withUnit(∇f_magnitude,0.0) || f_magnitude == withUnit(unit(f_magnitude), 0.0)
376+
if ∇f_magnitude == withUnit(unit(∇f_magnitude),0.0) || f_magnitude == withUnit(unit(f_magnitude), 0.0)
377377
_compute_step_acc_default(m, x)
378378
else
379379
_compute_step_acc(m, ∇f_magnitude, eps(f_magnitude))

0 commit comments

Comments
 (0)