def mult_and_reduce(input_fft_v, filters_fft_v, input_shape=None, filter_shape=None):
 if (input_shape is None):
  input_shape = input_fft_v.shape
 if (filter_shape is None):
  filter_shape = filters_fft_v.shape
 (b, ic, i0, i1_f, _) = input_shape
 oc = filter_shape[0]
 input_r = input_fft_v.reshape((b, ic, (i0 * i1_f), 2))
 filters_r = filters_fft_v.reshape((oc, ic, (i0 * i1_f), 2))
 input_s = input_r.dimshuffle(2, 0, 1, 3)
 filters_s = filters_r.dimshuffle(2, 1, 0, 3)
 output_s = batched_complex_dot(input_s, filters_s)
 output_r = output_s.dimshuffle(1, 2, 0, 3)
 output = output_r.reshape((b, oc, i0, i1_f, 2))
 return output

def mult_and_reduce ( input_fft_v , filters_fft_v , input_shape = None , filter_shape = None ) : if ( input_shape is None ) : input_shape = input_fft_v . shape if ( filter_shape is None ) : filter_shape = filters_fft_v . shape ( b , ic , i0 , i1_f , _ ) = input_shape oc = filter_shape [ 0 ] input_r = input_fft_v . reshape ( ( b , ic , ( i0 * i1_f ) , 2 ) ) filters_r = filters_fft_v . reshape ( ( oc , ic , ( i0 * i1_f ) , 2 ) ) input_s = input_r . dimshuffle ( 2 , 0 , 1 , 3 ) filters_s = filters_r . dimshuffle ( 2 , 1 , 0 , 3 ) output_s = batched_complex_dot ( input_s , filters_s ) output_r = output_s . dimshuffle ( 1 , 2 , 0 , 3 ) output = output_r . reshape ( ( b , oc , i0 , i1_f , 2 ) ) return output
parameters input_fft_v its .