Skip to content

Commit

Permalink
Fix extensions on julia 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed May 29, 2024
1 parent f82dae0 commit 02af560
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ext/TensorKitChainRulesCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion test/ad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
# -------------
Expand Down

0 comments on commit 02af560

Please sign in to comment.