@@ -72,37 +72,6 @@ def _check_norm(norm):
72
72
)
73
73
74
74
75
- # TODO: c2r keyword is place holder for irfftn
76
- def _cook_nd_args (a , s = None , axes = None , c2r = False ):
77
- if s is None :
78
- shapeless = True
79
- if axes is None :
80
- s = list (a .shape )
81
- else :
82
- s = numpy .take (a .shape , axes )
83
- else :
84
- shapeless = False
85
-
86
- for s_i in s :
87
- if s_i is not None and s_i < 1 and s_i != - 1 :
88
- raise ValueError (
89
- f"Invalid number of FFT data points ({ s_i } ) specified."
90
- )
91
-
92
- if axes is None :
93
- axes = list (range (- len (s ), 0 ))
94
-
95
- if len (s ) != len (axes ):
96
- raise ValueError ("Shape and axes have different lengths." )
97
-
98
- s = list (s )
99
- if c2r and shapeless :
100
- s [- 1 ] = (a .shape [axes [- 1 ]] - 1 ) * 2
101
- # use the whole input array along axis `i` if `s[i] == -1`
102
- s = [a .shape [_a ] if _s == - 1 else _s for _s , _a in zip (s , axes )]
103
- return s , axes
104
-
105
-
106
75
def _commit_descriptor (a , in_place , c2c , a_strides , index , axes ):
107
76
"""Commit the FFT descriptor for the input array."""
108
77
@@ -197,6 +166,37 @@ def _compute_result(dsc, a, out, forward, c2c, a_strides):
197
166
return result
198
167
199
168
169
+ # TODO: c2r keyword is place holder for irfftn
170
+ def _cook_nd_args (a , s = None , axes = None , c2r = False ):
171
+ if s is None :
172
+ shapeless = True
173
+ if axes is None :
174
+ s = list (a .shape )
175
+ else :
176
+ s = numpy .take (a .shape , axes )
177
+ else :
178
+ shapeless = False
179
+
180
+ for s_i in s :
181
+ if s_i is not None and s_i < 1 and s_i != - 1 :
182
+ raise ValueError (
183
+ f"Invalid number of FFT data points ({ s_i } ) specified."
184
+ )
185
+
186
+ if axes is None :
187
+ axes = list (range (- len (s ), 0 ))
188
+
189
+ if len (s ) != len (axes ):
190
+ raise ValueError ("Shape and axes have different lengths." )
191
+
192
+ s = list (s )
193
+ if c2r and shapeless :
194
+ s [- 1 ] = (a .shape [axes [- 1 ]] - 1 ) * 2
195
+ # use the whole input array along axis `i` if `s[i] == -1`
196
+ s = [a .shape [_a ] if _s == - 1 else _s for _s , _a in zip (s , axes )]
197
+ return s , axes
198
+
199
+
200
200
def _copy_array (x , complex_input ):
201
201
"""
202
202
Creating a C-contiguous copy of input array if input array has a negative
0 commit comments