Skip to content

Commit d863895

Browse files
Merge pull request #413 from pepijndevos/new-branch
Change typeof(x) <: y to x isa y
2 parents dbd631f + 68152be commit d863895

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ext/LinearSolveEnzymeExt.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ end
132132
function EnzymeCore.EnzymeRules.reverse(config, func::Const{typeof(LinearSolve.solve!)}, ::Type{RT}, cache, linsolve::EnzymeCore.Annotation{LP}; kwargs...) where {RT, LP <: LinearSolve.LinearCache}
133133
y, dys, _linsolve, dAs, dbs = cache
134134

135-
@assert !(typeof(linsolve) <: Const)
136-
@assert !(typeof(linsolve) <: Active)
135+
@assert !(linsolve isa Const)
136+
@assert !(linsolve isa Active)
137137

138138
if EnzymeRules.width(config) == 1
139139
dys = (dys,)

ext/LinearSolveIterativeSolversExt.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function LinearSolve.init_cacheval(alg::IterativeSolversJL, A, b, u, Pl, Pr, max
9090
end
9191

9292
function SciMLBase.solve!(cache::LinearCache, alg::IterativeSolversJL; kwargs...)
93-
if cache.isfresh || !(typeof(alg) <: IterativeSolvers.GMRESIterable)
93+
if cache.isfresh || !(alg isa IterativeSolvers.GMRESIterable)
9494
solver = LinearSolve.init_cacheval(alg, cache.A, cache.b, cache.u, cache.Pl,
9595
cache.Pr,
9696
cache.maxiters, cache.abstol, cache.reltol,

src/factorization.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ function init_cacheval(::SparspakFactorization, A, b, u, Pl, Pr, maxiters::Int,
13421342
reltol,
13431343
verbose::Bool, assumptions::OperatorAssumptions)
13441344
A = convert(AbstractMatrix, A)
1345-
if typeof(A) <: SparseArrays.AbstractSparseArray
1345+
if A isa SparseArrays.AbstractSparseArray
13461346
return sparspaklu(SparseMatrixCSC(size(A)..., getcolptr(A), rowvals(A),
13471347
nonzeros(A)),
13481348
factorize = false)

0 commit comments

Comments
 (0)