diff --git a/ext/LinearSolveEnzymeExt.jl b/ext/LinearSolveEnzymeExt.jl index 7cc613bb4..26d530d19 100644 --- a/ext/LinearSolveEnzymeExt.jl +++ b/ext/LinearSolveEnzymeExt.jl @@ -132,8 +132,8 @@ end function EnzymeCore.EnzymeRules.reverse(config, func::Const{typeof(LinearSolve.solve!)}, ::Type{RT}, cache, linsolve::EnzymeCore.Annotation{LP}; kwargs...) where {RT, LP <: LinearSolve.LinearCache} y, dys, _linsolve, dAs, dbs = cache - @assert !(typeof(linsolve) <: Const) - @assert !(typeof(linsolve) <: Active) + @assert !(linsolve isa Const) + @assert !(linsolve isa Active) if EnzymeRules.width(config) == 1 dys = (dys,) diff --git a/ext/LinearSolveIterativeSolversExt.jl b/ext/LinearSolveIterativeSolversExt.jl index 928a8bb6c..3d73197eb 100644 --- a/ext/LinearSolveIterativeSolversExt.jl +++ b/ext/LinearSolveIterativeSolversExt.jl @@ -90,7 +90,7 @@ function LinearSolve.init_cacheval(alg::IterativeSolversJL, A, b, u, Pl, Pr, max end function SciMLBase.solve!(cache::LinearCache, alg::IterativeSolversJL; kwargs...) - if cache.isfresh || !(typeof(alg) <: IterativeSolvers.GMRESIterable) + if cache.isfresh || !(alg isa IterativeSolvers.GMRESIterable) solver = LinearSolve.init_cacheval(alg, cache.A, cache.b, cache.u, cache.Pl, cache.Pr, cache.maxiters, cache.abstol, cache.reltol, diff --git a/src/factorization.jl b/src/factorization.jl index b34419ffe..1ec3bd861 100644 --- a/src/factorization.jl +++ b/src/factorization.jl @@ -1342,7 +1342,7 @@ function init_cacheval(::SparspakFactorization, A, b, u, Pl, Pr, maxiters::Int, reltol, verbose::Bool, assumptions::OperatorAssumptions) A = convert(AbstractMatrix, A) - if typeof(A) <: SparseArrays.AbstractSparseArray + if A isa SparseArrays.AbstractSparseArray return sparspaklu(SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A), nonzeros(A)), factorize = false)