-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
fuseaxes is used in matricize to fuse the axes of the codomain and domain:
TensorAlgebra.jl/src/matricize.jl
Lines 67 to 70 in 6d2a13d
| function matricize(::ReshapeFusion, a::AbstractArray, biperm::BlockedTrivialPermutation{2}) | |
| new_axes = fuseaxes(axes(a), biperm) | |
| return reshape(a, new_axes...) | |
| end |
It is defined as reducing over TensorProducts.⊗/TensorProducts.tensor_product:
TensorAlgebra.jl/src/matricize.jl
Lines 24 to 29 in 6d2a13d
| function fuseaxes( | |
| axes::Tuple{Vararg{AbstractUnitRange}}, blockedperm::AbstractBlockPermutation | |
| ) | |
| axesblocks = blocks(axes[blockedperm]) | |
| return map(block -> isempty(block) ? trivial_axis(axes) : ⊗(block...), axesblocks) | |
| end |
I think it would make sense to have a version of fuseaxes and tensor_product that accepts the FusionStyle as a first argument so they can be customized on the FusionStyle. That can make sure that the space determined for the matricization is consistent with the desired type of matricization (for example, in the case of fused or unfused matricization of symmetric tensors).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request