diff --git a/Project.toml b/Project.toml index 8b141718d..cbf882b88 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,6 @@ EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56" GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" -LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7" @@ -105,7 +104,6 @@ Krylov = "0.10" KrylovKit = "0.10" KrylovPreconditioners = "0.3" LAPACK_jll = "3" -LazyArrays = "2.3" Libdl = "1.10" LinearAlgebra = "1.10" MPI = "0.20" diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index eca4f0692..c85d8579c 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -15,7 +15,6 @@ using LinearAlgebra: LinearAlgebra, BlasInt, LU, Adjoint, BLAS, Bidiagonal, Bunc cholesky, cholesky!, diagind, dot, inv, ldiv!, ldlt!, lu, lu!, mul!, norm, qr, qr!, svd, svd! -using LazyArrays: @~, BroadcastArray using SciMLBase: SciMLBase, LinearAliasSpecifier, AbstractSciMLOperator, init, solve!, reinit!, solve, ReturnCode, LinearProblem using SciMLOperators: SciMLOperators, AbstractSciMLOperator, IdentityOperator, diff --git a/src/adjoint.jl b/src/adjoint.jl index 281a1ee69..5ffedaa0e 100644 --- a/src/adjoint.jl +++ b/src/adjoint.jl @@ -84,7 +84,7 @@ function CRC.rrule(::typeof(SciMLBase.solve), prob::LinearProblem, end tu = adjoint(sol.u) - ∂A = BroadcastArray(@~ .-(λ .* tu)) + ∂A = .-(λ .* tu) ∂b = λ ∂prob = LinearProblem(∂A, ∂b, ∂∅) diff --git a/test/adjoint.jl b/test/adjoint.jl index d599162df..3ecf0a8b5 100644 --- a/test/adjoint.jl +++ b/test/adjoint.jl @@ -1,7 +1,6 @@ using Zygote, ForwardDiff using LinearSolve, LinearAlgebra, Test using FiniteDiff, RecursiveFactorization -using LazyArrays: BroadcastArray n = 4 A = rand(n, n); @@ -19,7 +18,7 @@ end f(A, b1) # Uses BLAS dA, db1 = Zygote.gradient(f, A, b1) -@test dA isa BroadcastArray +@test dA isa AbstractMatrix dA2 = ForwardDiff.gradient(x -> f(x, eltype(x).(b1)), copy(A)) db12 = ForwardDiff.gradient(x -> f(eltype(x).(A), x), copy(b1)) @@ -37,7 +36,7 @@ _ff = (x, _ff(copy(A), copy(b1)) dA, db1 = Zygote.gradient(_ff, copy(A), copy(b1)) -@test dA isa BroadcastArray +@test dA isa AbstractMatrix dA2 = ForwardDiff.gradient(x -> f(x, eltype(x).(b1)), copy(A)) db12 = ForwardDiff.gradient(x -> f(eltype(x).(A), x), copy(b1)) @@ -58,7 +57,7 @@ function f3(A, b1, b2; alg = KrylovJL_GMRES()) end dA, db1, db2 = Zygote.gradient(f3, A, b1, b1) -@test dA isa BroadcastArray +@test dA isa AbstractMatrix dA2 = FiniteDiff.finite_difference_gradient( x -> f3(x, eltype(x).(b1), eltype(x).(b1)), copy(A)) @@ -83,7 +82,7 @@ function f4(A, b1, b2; alg = LUFactorization()) end dA, db1, db2 = Zygote.gradient(f4, A, b1, b1) -@test dA isa BroadcastArray +@test dA isa AbstractMatrix dA2 = ForwardDiff.gradient(x -> f4(x, eltype(x).(b1), eltype(x).(b1)), copy(A)) db12 = ForwardDiff.gradient(x -> f4(eltype(x).(A), x, eltype(x).(b1)), copy(b1))