From 089e5c2498fe76110ac0a15445c01783b9fdef32 Mon Sep 17 00:00:00 2001 From: Pepijn de Vos Date: Thu, 2 Nov 2023 18:24:09 +0100 Subject: [PATCH] Change typeof(x) <: y to x isa y --- src/advancedHMC_MCMC.jl | 2 +- src/pinn_types.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/advancedHMC_MCMC.jl b/src/advancedHMC_MCMC.jl index 2276b47074..df174e2538 100644 --- a/src/advancedHMC_MCMC.jl +++ b/src/advancedHMC_MCMC.jl @@ -489,7 +489,7 @@ function ahmc_bayesian_pinn_ode(prob::DiffEqBase.ODEProblem, chain; strategy = strategy == GridTraining ? strategy(physdt) : strategy if dataset != [nothing] && - (length(dataset) < 2 || !(typeof(dataset) <: Vector{<:Vector{<:AbstractFloat}})) + (length(dataset) < 2 || !(dataset isa Vector{<:Vector{<:AbstractFloat}})) throw(error("Invalid dataset. dataset would be timeseries (x̂,t) where type: Vector{Vector{AbstractFloat}")) end diff --git a/src/pinn_types.jl b/src/pinn_types.jl index 8a4766d122..428f03fc36 100644 --- a/src/pinn_types.jl +++ b/src/pinn_types.jl @@ -106,7 +106,7 @@ struct PhysicsInformedNN{T, P, PH, DER, PE, AL, ADA, LOG, K} <: AbstractPINN log_options = LogOptions(), iteration = nothing, kwargs...) - multioutput = typeof(chain) <: AbstractArray + multioutput = chain isa AbstractArray if phi === nothing if multioutput