Boil down indexmanip rules to add_transform#486
Conversation
| TC = VectorInterface.promote_scale(Cval, α.val) | ||
| if scalartype(A.dval) <: Real && !(TC <: Real) | ||
| ΔAc = TO.tensoralloc_add(TC, C.dval, pΔA, false, Val(false)) | ||
| TK.add_transform!(ΔAc, C.dval, pΔA, transformer.val, conj(α.val), Zero(), bavs...) |
There was a problem hiding this comment.
I'm really surprised this works though - the transformer is the metadata needed to efficiently permute and recouple, but this depends on the value of p so unless this is accidentally a self-inverse permutation where C and A have the same structure, this should probably give wrong results?
There was a problem hiding this comment.
I was testing this on spaces that are "too easy" maybe, for the A4 ones it doesn't work :(
There was a problem hiding this comment.
Yeah, the problem is that at this point we no longer have access to what kind of transformer it is, so it is not possible to construct the reverse one from that.
There was a problem hiding this comment.
But my negative lines diff!!!!!!
Codecov Report❌ Patch coverage is
... and 56 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Enzyme can't reverse diff through
add_transform(yet) without some rules for theOhMyThreads.jlfunctions, which I was a little lazy about adding. But it can make a nice forward rule, it seems.