@@ -123,41 +123,17 @@ function matricize_axes(a::AbstractArray, ndims_codomain::Val)
123123 return matricize_axes (FusionStyle (a), a, ndims_codomain)
124124end
125125
126- # `bipermutedimsopadd!` / `bipermutedimsop` — bipermutation versions of
127- # `permutedimsopadd!` / `permuteddims` with an element-wise op folded in.
128- #
129- # These are intended to become the primary overload points for downstream array
130- # types that want to fold ops into a bipartitioned permutation copy (e.g., fuse
131- # `conj` into the copy, or use lazy wrappers like `StridedView` with op metadata).
132- # For now, `bipermutedimsopadd!` delegates to the flat-permutation `permutedimsopadd!`.
133- # In a future PR, the dependency will flip so that `permutedimsopadd!` wraps
134- # `bipermutedimsopadd!`.
135-
136- """
137- bipermutedimsopadd!(dest, op, src, perm_codomain, perm_domain, α, β)
138-
139- Like `permutedimsopadd!`, but takes a bipartitioned permutation
140- `(perm_codomain, perm_domain)`.
141- """
142- function bipermutedimsopadd! (
143- dest:: AbstractArray , op, src:: AbstractArray ,
144- perm_codomain, perm_domain,
145- α:: Number , β:: Number
146- )
147- return permutedimsopadd! (dest, op, src, (perm_codomain... , perm_domain... ), α, β)
148- end
149-
150126"""
151127 bipermutedimsop(op, src, perm_codomain, perm_domain)
152128
153- Non-mutating version of `bipermutedimsopadd !`: returns
129+ Non-mutating version of bipermutation `permutedimsopadd !`: returns
154130`op.(permutedims(src, (perm_codomain..., perm_domain...)))`. Has "maybe alias"
155131semantics — the result may be a view/wrapper aliasing `src` or a fresh copy.
156132"""
157133function bipermutedimsop (op, src:: AbstractArray , perm_codomain, perm_domain)
158134 perm = (perm_codomain... , perm_domain... )
159135 dest = similar (src, map (i -> size (src, i), perm))
160- return bipermutedimsopadd ! (dest, op, src, perm_codomain, perm_domain, true , false )
136+ return permutedimsopadd ! (dest, op, src, perm_codomain, perm_domain, true , false )
161137end
162138
163139# Inner version takes a list of sub-permutations, overload this one if needed.
0 commit comments