Skip to content

Commit 2126d3f

Browse files
committed
Cleanup and turn off planar tests
1 parent dd2d1c5 commit 2126d3f

3 files changed

Lines changed: 6 additions & 15 deletions

File tree

ext/TensorKitEnzymeExt/planaroperations.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function EnzymeRules.augmented_primal(
2121
)
2222
cacheC = !isa(β, Const) && copy(C.val)
2323
cacheA = EnzymeRules.overwritten(config)[3] ? copy(A.val) : nothing
24-
2524
TensorKit.planartrace!(C.val, A.val, p.val, q.val, α.val, β.val, backend.val, allocator.val)
2625
primal = EnzymeRules.needs_primal(config) ? C.val : nothing
2726
shadow = EnzymeRules.needs_shadow(config) ? C.dval : nothing
@@ -43,26 +42,18 @@ function EnzymeRules.reverse(
4342
cacheC, cacheA = cache
4443
Cval = something(cacheC, C.val)
4544
Aval = something(cacheA, A.val)
46-
4745
if !isa(A, Const) && !isa(C, Const)
4846
planartrace_pullback_ΔA!(A.dval, C.dval, Aval, p.val, q.val, α.val, backend.val, allocator.val)
4947
end
5048
Δαr = if !isa(α, Const) && !isa(C, Const)
51-
planartrace_pullback_Δα(C.dval, A.val, p.val, q.val, α.val, backend.val, allocator.val)
49+
planartrace_pullback_Δα(C.dval, Aval, p.val, q.val, α.val, backend.val, allocator.val)
5250
elseif !isa(α, Const)
5351
zero.val)
5452
else
5553
nothing
5654
end
57-
Δβr = if !isa(β, Const) && !isa(C, Const)
58-
pullback_dβ(C.dval, C.val, β)
59-
elseif !isa(β, Const)
60-
zero.val)
61-
else
62-
nothing
63-
end
55+
Δβr = pullback_dΒ(β, C, Cval)
6456
!isa(C, Const) && pullback_dC!(C.dval, β.val)
65-
6657
return nothing, nothing, nothing, nothing, Δαr, Δβr, nothing, nothing
6758
end
6859

test/enzyme-planaroperations/planarcontract.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using Random
77

88
spacelist = ad_spacelist(fast_tests)
99
eltypes = (Float64, ComplexF64)
10-
10+
#=
1111
@timedtestset "Enzyme - PlanarOperations (planarcontract): $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
1212
atol = default_tol(T)
1313
rtol = default_tol(T)
@@ -51,4 +51,4 @@ eltypes = (Float64, ComplexF64)
5151
EnzymeTestUtils.test_reverse(TensorKit.planarcontract!, TC, (C, TC), (A, TA), (pA, Const), (B, TB), (pB, Const), (pAB, Const), (α, Active), (β, Const); atol, rtol)
5252
EnzymeTestUtils.test_reverse(TensorKit.planarcontract!, TC, (C, TC), (A, TA), (pA, Const), (B, TB), (pB, Const), (pAB, Const), (α, Active), (β, Active); atol, rtol)
5353
end
54-
end
54+
end=#

test/enzyme-planaroperations/planartrace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using Random
77

88
spacelist = ad_spacelist(fast_tests)
99
eltypes = (Float64, ComplexF64)
10-
10+
#=
1111
@timedtestset "Enzyme - PlanarOperations (planartrace): $(TensorKit.type_repr(sectortype(eltype(V)))) ($T)" for V in spacelist, T in eltypes
1212
atol = default_tol(T)
1313
rtol = default_tol(T)
@@ -32,4 +32,4 @@ eltypes = (Float64, ComplexF64)
3232
EnzymeTestUtils.test_reverse(TensorKit.planartrace!, Active, (C, Duplicated), (A, Duplicated), (p, Const), (q, Const), (α, Active), (β, Const), (TensorOperations.DefaultBackend(), Const), (TensorOperations.DefaultAllocator(), Const); atol, rtol)
3333
EnzymeTestUtils.test_reverse(TensorKit.planartrace!, Active, (C, Duplicated), (A, Duplicated), (p, Const), (q, Const), (α, Const), (β, Active), (TensorOperations.DefaultBackend(), Const), (TensorOperations.DefaultAllocator(), Const); atol, rtol)
3434
EnzymeTestUtils.test_reverse(TensorKit.planartrace!, Active, (C, Duplicated), (A, Duplicated), (p, Const), (q, Const), (α, Active), (β, Active), (TensorOperations.DefaultBackend(), Const), (TensorOperations.DefaultAllocator(), Const); atol, rtol)
35-
end
35+
end=#

0 commit comments

Comments
 (0)