@@ -14,13 +14,13 @@ class RFFTOp(Op):
14
14
15
15
def output_type (self , inp ):
16
16
# add extra dim for real/imag
17
- return TensorType (inp .dtype , shape = (None ,) * ( inp .type .ndim + 1 ))
17
+ return TensorType (inp .dtype , shape = (( None ,) * inp .type .ndim ) + ( 2 , ))
18
18
19
19
def make_node (self , a , s = None ):
20
20
a = as_tensor_variable (a )
21
21
if a .ndim < 2 :
22
22
raise TypeError (
23
- f"{ self .__class__ .__name__ } : input must have dimension > 2, with first dimension batches"
23
+ f"{ self .__class__ .__name__ } : input must have dimension >= 2, with first dimension batches"
24
24
)
25
25
26
26
if s is None :
@@ -39,9 +39,10 @@ def perform(self, node, inputs, output_storage):
39
39
a = inputs [0 ]
40
40
s = inputs [1 ]
41
41
42
+ # FIXME: This call is deprecated in numpy 2.0
43
+ # axis must be provided when s is not None
42
44
A = np .fft .rfftn (a , s = tuple (s ))
43
- # Format output with two extra dimensions for real and imaginary
44
- # parts.
45
+ # Format output with two extra dimensions for real and imaginary parts.
45
46
out = np .zeros ((* A .shape , 2 ), dtype = a .dtype )
46
47
out [..., 0 ], out [..., 1 ] = np .real (A ), np .imag (A )
47
48
output_storage [0 ][0 ] = out
0 commit comments