diff --git a/ext/TensorKitChainRulesCoreExt.jl b/ext/TensorKitChainRulesCoreExt.jl index 8a5f4194..345fb6da 100644 --- a/ext/TensorKitChainRulesCoreExt.jl +++ b/ext/TensorKitChainRulesCoreExt.jl @@ -11,7 +11,11 @@ import TensorOperations as TO using TensorOperations: Backend, promote_contract using VectorInterface: promote_scale, promote_add -ext = Base.get_extension(TensorOperations, :TensorOperationsChainRulesCoreExt) +ext = @static if isdefined(Base, :get_extension) + Base.get_extension(TensorOperations, :TensorOperationsChainRulesCoreExt) +else + TensorOperations.TensorOperationsChainRulesCoreExt +end const _conj = ext._conj const trivtuple = ext.trivtuple diff --git a/test/ad.jl b/test/ad.jl index e47d5c1b..836cd70f 100644 --- a/test/ad.jl +++ b/test/ad.jl @@ -4,7 +4,11 @@ using Random using FiniteDifferences using LinearAlgebra -_repartition = Base.get_extension(TensorKit, :TensorKitChainRulesCoreExt)._repartition +const _repartition = @static if isdefined(Base, :get_extension) + Base.get_extension(TensorKit, :TensorKitChainRulesCoreExt)._repartition +else + TensorKit.TensorKitChainRulesCoreExt._repartition +end # Test utility # -------------