@@ -74,30 +74,19 @@ function matricize(a::AbstractArray, permblock1::Tuple, permblock2::Tuple)
74
74
end
75
75
76
76
# ==================================== unmatricize =======================================
77
- function unmatricize (
78
- m:: AbstractMatrix ,
79
- axes:: Tuple{Vararg{AbstractUnitRange}} ,
80
- biperm:: AbstractBlockPermutation{2} ,
81
- )
77
+ function unmatricize (m:: AbstractMatrix , axes, biperm:: AbstractBlockPermutation{2} )
82
78
length (axes) == length (biperm) || throw (ArgumentError (" axes do not match permutation" ))
83
79
return unmatricize (FusionStyle (m), m, axes, biperm)
84
80
end
85
81
86
82
function unmatricize (
87
- :: FusionStyle ,
88
- m:: AbstractMatrix ,
89
- axes:: Tuple{Vararg{AbstractUnitRange}} ,
90
- biperm:: AbstractBlockPermutation{2} ,
83
+ :: FusionStyle , m:: AbstractMatrix , axes, biperm:: AbstractBlockPermutation{2}
91
84
)
92
85
blocked_axes = axes[biperm]
93
86
a_perm = unmatricize (m, blocked_axes)
94
87
return permuteblockeddims (a_perm, invperm (biperm))
95
88
end
96
89
97
- function unmatricize (:: ReshapeFusion , m:: AbstractMatrix , axes:: AbstractUnitRange... )
98
- return reshape (m, axes... )
99
- end
100
-
101
90
function unmatricize (
102
91
:: ReshapeFusion ,
103
92
m:: AbstractMatrix ,
@@ -106,9 +95,7 @@ function unmatricize(
106
95
return reshape (m, Tuple (blocked_axes)... )
107
96
end
108
97
109
- function unmatricize (
110
- m:: AbstractMatrix , blocked_axes:: BlockedTuple{2,<:Any,<:Tuple{Vararg{AbstractUnitRange}}}
111
- )
98
+ function unmatricize (m:: AbstractMatrix , blocked_axes)
112
99
return unmatricize (FusionStyle (m), m, blocked_axes)
113
100
end
114
101
@@ -121,9 +108,7 @@ function unmatricize(
121
108
return unmatricize (m, blocked_axes)
122
109
end
123
110
124
- function unmatricize! (
125
- a:: AbstractArray , m:: AbstractMatrix , biperm:: AbstractBlockPermutation{2}
126
- )
111
+ function unmatricize! (a, m:: AbstractMatrix , biperm:: AbstractBlockPermutation{2} )
127
112
ndims (a) == length (biperm) ||
128
113
throw (ArgumentError (" destination does not match permutation" ))
129
114
blocked_axes = axes (a)[biperm]
0 commit comments