@@ -28,10 +28,10 @@ function ADTypes.jacobian_sparsity(f, x, detector::DI.DenseSparsityDetector{:ite
2828 if DI. pushforward_performance (backend) isa DI. PushforwardFast
2929 p = similar (y)
3030 prep = DI. prepare_pushforward_same_point (
31- f, backend, x, (DI. basis (backend, x, first (eachindex (x))),)
31+ f, backend, x, (DI. basis (x, first (eachindex (x))),)
3232 )
3333 for (kj, j) in enumerate (eachindex (x))
34- pushforward! (f, (p,), prep, backend, x, (DI. basis (backend, x, j),))
34+ pushforward! (f, (p,), prep, backend, x, (DI. basis (x, j),))
3535 for ki in LinearIndices (p)
3636 if abs (p[ki]) > atol
3737 push! (I, ki)
@@ -42,10 +42,10 @@ function ADTypes.jacobian_sparsity(f, x, detector::DI.DenseSparsityDetector{:ite
4242 else
4343 p = similar (x)
4444 prep = DI. prepare_pullback_same_point (
45- f, backend, x, (DI. basis (backend, y, first (eachindex (y))),)
45+ f, backend, x, (DI. basis (y, first (eachindex (y))),)
4646 )
4747 for (ki, i) in enumerate (eachindex (y))
48- pullback! (f, (p,), prep, backend, x, (DI. basis (backend, y, i),))
48+ pullback! (f, (p,), prep, backend, x, (DI. basis (y, i),))
4949 for kj in LinearIndices (p)
5050 if abs (p[kj]) > atol
5151 push! (I, ki)
@@ -64,10 +64,10 @@ function ADTypes.jacobian_sparsity(f!, y, x, detector::DI.DenseSparsityDetector{
6464 if DI. pushforward_performance (backend) isa DI. PushforwardFast
6565 p = similar (y)
6666 prep = DI. prepare_pushforward_same_point (
67- f!, y, backend, x, (DI. basis (backend, x, first (eachindex (x))),)
67+ f!, y, backend, x, (DI. basis (x, first (eachindex (x))),)
6868 )
6969 for (kj, j) in enumerate (eachindex (x))
70- pushforward! (f!, y, (p,), prep, backend, x, (DI. basis (backend, x, j),))
70+ pushforward! (f!, y, (p,), prep, backend, x, (DI. basis (x, j),))
7171 for ki in LinearIndices (p)
7272 if abs (p[ki]) > atol
7373 push! (I, ki)
@@ -78,10 +78,10 @@ function ADTypes.jacobian_sparsity(f!, y, x, detector::DI.DenseSparsityDetector{
7878 else
7979 p = similar (x)
8080 prep = DI. prepare_pullback_same_point (
81- f!, y, backend, x, (DI. basis (backend, y, first (eachindex (y))),)
81+ f!, y, backend, x, (DI. basis (y, first (eachindex (y))),)
8282 )
8383 for (ki, i) in enumerate (eachindex (y))
84- pullback! (f!, y, (p,), prep, backend, x, (DI. basis (backend, y, i),))
84+ pullback! (f!, y, (p,), prep, backend, x, (DI. basis (y, i),))
8585 for kj in LinearIndices (p)
8686 if abs (p[kj]) > atol
8787 push! (I, ki)
@@ -98,11 +98,9 @@ function ADTypes.hessian_sparsity(f, x, detector::DI.DenseSparsityDetector{:iter
9898 n = length (x)
9999 I, J = Int[], Int[]
100100 p = similar (x)
101- prep = DI. prepare_hvp_same_point (
102- f, backend, x, (DI. basis (backend, x, first (eachindex (x))),)
103- )
101+ prep = DI. prepare_hvp_same_point (f, backend, x, (DI. basis (x, first (eachindex (x))),))
104102 for (kj, j) in enumerate (eachindex (x))
105- hvp! (f, (p,), prep, backend, x, (DI. basis (backend, x, j),))
103+ hvp! (f, (p,), prep, backend, x, (DI. basis (x, j),))
106104 for ki in LinearIndices (p)
107105 if abs (p[ki]) > atol
108106 push! (I, ki)
0 commit comments