We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 832ceb7 commit 6a19a83Copy full SHA for 6a19a83
2 files changed
ext/TensorKitEnzymeExt/indexmanipulations.jl
@@ -116,33 +116,6 @@ function EnzymeRules.reverse(
116
return nothing, nothing, nothing, nothing, Δαr, Δβr, map(Returns(nothing), ba)...
117
end
118
119
-function EnzymeRules.augmented_primal(
120
- config::EnzymeRules.RevConfigWidth{1},
121
- func::Const{typeof(twist!)},
122
- ::Type{RT},
123
- t::Annotation{<:AbstractTensorMap},
124
- inds::Const;
125
- inv::Bool = false
126
- ) where {RT}
127
- twist!(t.val, inds.val; inv)
128
- primal = EnzymeRules.needs_primal(config) ? t.val : nothing
129
- shadow = EnzymeRules.needs_shadow(config) ? t.dval : nothing
130
- return EnzymeRules.AugmentedReturn(primal, shadow, nothing)
131
-end
132
-
133
-function EnzymeRules.reverse(
134
135
136
137
- cache,
138
139
140
141
142
- !isa(t, Const) && twist!(t.dval, inds.val; inv = !inv)
143
- return (nothing, nothing)
144
145
146
function EnzymeRules.augmented_primal(
147
config::EnzymeRules.RevConfigWidth{1},
148
func::Const{typeof(flip)},
test/enzyme-indexmanipulations-flip-twist/twist.jl
@@ -20,6 +20,10 @@ if !Sys.iswindows() && VERSION > v"1.11.0-rc"
20
EnzymeTestUtils.test_reverse(twist!, TA, (copy(A), TA), ([1, 3], Const); atol, rtol, fkwargs = (inv = true,))
21
EnzymeTestUtils.test_reverse(twist!, TA, (copy(A), TA), (1, Const); atol, rtol)
22
EnzymeTestUtils.test_reverse(twist!, TA, (copy(A), TA), ([1, 3], Const); atol, rtol)
23
+ EnzymeTestUtils.test_forward(twist!, TA, (copy(A), TA), (1, Const); atol, rtol, fkwargs = (inv = false,))
24
+ EnzymeTestUtils.test_forward(twist!, TA, (copy(A), TA), ([1, 3], Const); atol, rtol, fkwargs = (inv = true,))
25
+ EnzymeTestUtils.test_forward(twist!, TA, (copy(A), TA), (1, Const); atol, rtol)
26
+ EnzymeTestUtils.test_forward(twist!, TA, (copy(A), TA), ([1, 3], Const); atol, rtol)
27
28
29
0 commit comments