
    AVh                     h   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZm Z m!Z! ddl"m#Z# dde#e!ejH                  f   de#e!ejH                  f   fdZ%  ed       ejL                  e%            Z'de#e!ejH                  f   de#e!ejH                  f   fdZ(dde#e!ejH                  f   de#e!ejH                  f   fdZ)  ed       ejL                  e)            Z*de#e!ejH                  f   de#e!ejH                  f   fdZ+dde#e!ejH                  f   de#e!ejH                  f   fdZ,  ed       ejL                  e,            Z-de#e!ejH                  f   de#e!ejH                  f   fdZ.dde#e!ejH                  f   de#e!ejH                  f   fdZ/  ed       ejL                  e/            Z0de#e!ejH                  f   de#e!ejH                  f   fdZ1dde#e!ejH                  f   de#e!ejH                  f   fdZ2  ed        ejL                  e2            Z3de#e!ejH                  f   de#e!ejH                  f   fd!Z4dde#e!ejH                  f   de#e!ejH                  f   fd"Z5  ed#       ejL                  e5            Z6de#e!ejH                  f   de#e!ejH                  f   fd$Z7 ed%d&d'      Z8ejr                  ejt                   ed(g d)*       ed+d,      dde#e!e8f   de#e!e8f   fd-                            Z;  ed.       ejL                  e;            Z<e;jz                  j|                  Z?de#e!e8f   de#e!e8f   fd/Z@ ed0d&d'      ZAejr                  ejt                   ed1g d2*       ed3d4      dde#e!eAf   de#e!eAf   fd5                            ZB  ed6       ejL                  eB            ZCeBjz                  j|                  ZDde#e!eAf   de#e!eAf   fd7ZE ed8d&d'      ZFejr                  ejt                   ed9g d:*       ed;d<      dde#e!eFf   de#e!eFf   fd=                            ZG  ed>       ejL                  eG            ZHeGjz                  j|                  ZIde#e!eFf   de#e!eFf   fd?ZJ ed@d&d'      ZKejr                  ejt                   edA      dde#e!eKf   dBe#e!ej                  f   dCe#e!ej                  f   de#e!eKf   fdD                     ZM  edE       ejL                  eM            ZNeMjz                  j|                  ZOde#e!eKf   dBe#e!ej                  f   dCe#e!ej                  f   de#e!eKf   fdFZP edGd&d'      ZQejr                  ejt                   edHg dI*       edJdK      dde#e!eQf   de#e!eQf   fdL                            ZR  edM       ejL                  eR            ZSeRjz                  j|                  ZTde#e!eQf   de#e!eQf   fdNZU edOd&d'      ZVejr                  ejt                   edPg dQ*       edRdS      dde#e!eVf   de#e!eVf   fdT                            ZW  edU       ejL                  eW            ZXeWjz                  j|                  ZYde#e!eVf   de#e!eVf   fdVZZ edWd&d'      Z[ejr                  ejt                   edXg dY*       edZd[      dde#e!e[f   de#e!e[f   fd\                            Z\  ed]       ejL                  e\            Z]e\jz                  j|                  Z^de#e!e[f   de#e!e[f   fd^Z_ ed_d&d'      Z`ejr                  ejt                   ed`      dde#e!e`f   dBe#e!ej                  f   dCe#e!ej                  f   de#e!e`f   fda                     Za  edb       ejL                  ea            Zbeajz                  j|                  Zcde#e!e`f   dBe#e!ej                  f   dCe#e!ej                  f   de#e!e`f   fdcZd edddedf      Ze edgd&d'      Zfej                  dfde#e!eff   dBe#e!ej                  f   dheede#e!eef   fdiZh  edj       ejL                  eh            Zide#e!eff   dBe#e!ej                  f   dheede#e!eef   fdkZj edldedf      Zk edmd&d'      Zlej                  dfde#e!elf   dBe#e!ej                  f   dhekde#e!ekf   fdnZm  edo       ejL                  em            Znde#e!elf   dBe#e!ej                  f   dhekde#e!ekf   fdpZo edqdedf      Zp edrd&d'      Zqej                  dfde#e!eqf   dBe#e!ej                  f   dhepde#e!epf   fdsZr  edt       ejL                  er            Zsde#e!eqf   dBe#e!ej                  f   dhepde#e!epf   fduZt edvdedf      Zu edwd&d'      Zvejr                  ejt                   edx      ej                  dfde#e!evf   dBe#e!ej                  f   dCe#e!ej                  f   dheude#e!euf   f
dy                     Zw  edz       ejL                  ew            Zxewjz                  j|                  Zyde#e!evf   dBe#e!ej                  f   dCe#e!ej                  f   dheude#e!euf   f
d{Zz ed|dedf      Z{ ed}d&d'      Z|ej                  dfde#e!e{f   dBe#e!ej                  f   d~e|de#e!e|f   fdZ~  ed       ejL                  e~            Zde#e!e{f   dBe#e!ej                  f   d~e|de#e!e|f   fdZ eddedf      Z edd&d'      Zej                  dfde#e!ef   dBe#e!ej                  f   d~ede#e!ef   fdZ  ed       ejL                  e            Zde#e!ef   dBe#e!ej                  f   d~ede#e!ef   fdZ eddedf      Z edd&d'      Zej                  dfde#e!ef   dBe#e!ej                  f   d~ede#e!ef   fdZ  ed       ejL                  e            Zde#e!ef   dBe#e!ej                  f   d~ede#e!ef   fdZ eddedf      Z edd&d'      Zejr                  ejt                   ed      ej                  dfde#e!ef   dBe#e!ej                  f   dCe#e!ej                  f   d~ede#e!ef   f
d                     Z  ed       ejL                  e            Zejz                  j|                  Zde#e!ef   dBe#e!ej                  f   dCe#e!ej                  f   d~ede#e!ef   f
dZy)zUPython wrappers around TensorFlow ops.

This file is MACHINE GENERATED! Do not edit.
    N)
pywrap_tfe)context)core)execute)dtypes)annotation_types)op_def_registry)ops)op_def_library)deprecated_endpoints)dispatch)	tf_export)TypeVarListAny)	Annotatedinputreturnc                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)TODO: add doc.

  Args:
    input: A `Tensor` of type `complex64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `complex64`.
  BatchFFTNnamectxr   r    )_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackExceptionbatch_fft_eager_fallback_SymbolicException_op_def_library_apply_op_helper_executemust_record_gradientinputsrecord_gradientr   r   _ctxtld_resulte__op_outputs_attrs_inputs_flats              V/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_spectral_ops.py	batch_fftr9      s'    
			0h..0$#\\11j$'gn (88%d,!QXQK'""$F::LL&'3('	.' && -
##At,,## 
%
d& &## 
0    B< <DC**DDD D+*D+zraw_ops.BatchFFTc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns   BatchFFT   r,   attrsr   r   r   r#   convert_to_tensor_dtypes	complex64r*   r   r+   r-   r   r   r   r7   r6   r1   s         r8   r&   r&   B   sr    

 
 (9(9
:%,&[!L#)s?'""$L&'3('	.    c                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)r   
BatchFFT2DNr   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   batch_fft2d_eager_fallbackr'   r(   r)   r*   r+   r,   r-   r.   s              r8   batch_fft2drH   O   '    
			0h..0$#\\11lD%)gn (88E.!QXQK'""$F::LlFG5('	.' && -
##At,,## 
'
d& &## 
r:   zraw_ops.BatchFFT2Dc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns
   BatchFFT2Dr<   r=   rF   r?   rC   s         r8   rG   rG   x   r    

 
 (9(9
:%,&]Al#)s?'""$lFG5('	.rD   c                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)r   
BatchFFT3DNr   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   batch_fft3d_eager_fallbackr'   r(   r)   r*   r+   r,   r-   r.   s              r8   batch_fft3drO      rI   r:   zraw_ops.BatchFFT3Dc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns
   BatchFFT3Dr<   r=   rM   r?   rC   s         r8   rN   rN      rK   rD   c                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)r   	BatchIFFTNr   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   batch_ifft_eager_fallbackr'   r(   r)   r*   r+   r,   r-   r.   s              r8   
batch_ifftrT      s'    
			0h..0$#\\11k4(gn (885t-!QXQK'""$F::L\674('	.' && -
##At,,## 
&
d& &## 
r:   zraw_ops.BatchIFFTc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns	   BatchIFFTr<   r=   rR   r?   rC   s         r8   rS   rS      sr    

 
 (9(9
:%,&\1\#)s?'""$\674('	.rD   c                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)r   BatchIFFT2DNr   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   batch_ifft2d_eager_fallbackr'   r(   r)   r*   r+   r,   r-   r.   s              r8   batch_ifft2drY      '    
			0h..0$#\\11mT5*gn (88U/!QXQK'""$F::L|VW6('	.' && -
##At,,## 
(
d& &## 
r:   zraw_ops.BatchIFFT2Dc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns   BatchIFFT2Dr<   r=   rW   r?   rC   s         r8   rX   rX     r    

 
 (9(9
:%,&^Q|#)s?'""$|VW6('	.rD   c                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||      S # t        j                  $ r Y w xY w)r   BatchIFFT3DNr   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   batch_ifft3d_eager_fallbackr'   r(   r)   r*   r+   r,   r-   r.   s              r8   batch_ifft3dr`   '  rZ   r:   zraw_ops.BatchIFFT3Dc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns   BatchIFFT3Dr<   r=   r^   r?   rC   s         r8   r_   r_   P  r\   rD   TV_FFT_Tcomplexz_atypes.Complex128z_atypes.Complex64
signal.fft)rc   spectral.fftfft)v1rd   re   c           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)a_  Fast Fourier transform.

  Computes the 1-dimensional discrete Fourier transform over the inner-most
  dimension of `input`.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  FFTNr   r   r   Tcomplex)r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_fftNotImplementedfft_eager_fallbackr'   	TypeError
ValueError	_dispatchr   re   dictOpDispatcherNOT_SUPPORTEDr(   r)   r*   r+   _get_attr_typer,   r-   r.   s              r8   re   re   _  s   $ 
			0h..0$#\\11eT5"gn, "	Gn$n	
)::U'Aq#x QK'""$#,,Z89F::L|VW.('	.W && -
##At,,## 
#$.$ g		&
d& &## 
z" ""TD1g 
	..<<	<  Z	  
  
r4e$/
G i,,:::n	
P    C& 3G &D-9DD-,D-1E 	E G,AG GAHHzraw_ops.FFTc                 >   t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } | g}d|f}t        j
                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   FFTr<   r=   rh   r*   args_to_matching_eagerrA   rB   
complex128r   r+   r-   r   r   r   _attr_Tcomplexr7   r6   r1   s          r8   rl   rl     s    %<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5,'&VQ|6!$41'""$|VW.('	.rD   TV_FFT2D_Tcomplexsignal.fft2d)r|   spectral.fft2dfft2dr}   r~   c           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)ae  2D fast Fourier transform.

  Computes the 2-dimensional discrete Fourier transform over the inner-most
  2 dimensions of `input`.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  FFT2DNr   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_fft2drk   fft2d_eager_fallbackr'   rm   rn   ro   r   r~   rp   rq   rr   r(   r)   r*   r+   rs   r,   r-   r.   s              r8   r~   r~        $ 
			0h..0$#\\11gtU$gn, $	Gn$n	
)::u4)Aq#x QK'""$#,,Z89F::Lvw0('	.W && -
##At,,## 
%$.$ g		&!
d& &## 
z" ""2t%d3g 
	..<<	<  Z	  
  
TD1
G i,,:::n	
rt   zraw_ops.FFT2Dc                 >   t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } | g}d|f}t        j
                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   FFT2Dr<   r=   r   rv   ry   s          r8   r   r         %<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5,'&XqV!$41'""$vw0('	.rD   TV_FFT3D_Tcomplexsignal.fft3d)r   spectral.fft3dfft3dr   r   c           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)ae  3D fast Fourier transform.

  Computes the 3-dimensional discrete Fourier transform over the inner-most 3
  dimensions of `input`.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  FFT3DNr   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_fft3drk   fft3d_eager_fallbackr'   rm   rn   ro   r   r   rp   rq   rr   r(   r)   r*   r+   rs   r,   r-   r.   s              r8   r   r     r   rt   zraw_ops.FFT3Dc                 >   t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } | g}d|f}t        j
                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   FFT3Dr<   r=   r   rv   ry   s          r8   r   r   [  r   rD   TV_FFTND_Tcomplexfftnd
fft_lengthaxesc                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||      }|S t        | |||fd      }|t        ur|S 	 t/        j0                  d| |||      \  }}}	}
|
dd }t3        j4                         r7d|	j7                  d      f}|	j8                  }t3        j:                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||fd      }|t        ur|S t        | ||||      S # t        j                  $ r Y t        t         f$ rJ t#        j$                  t&        dt)        | |||            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rJ t#        j$                  t&        dt)        | |||            }|t"        j*                  j,                  ur|cY S  w xY w)a  ND fast Fourier transform.

  Computes the n-dimensional discrete Fourier transform over
  designated dimensions of `input`. The designated dimensions of
  `input` are assumed to be the result of `FFTND`.

  If fft_length[i]<shape(input)[i], the input is cropped. If
  fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length
  is not given, the default shape(input) is used.

  Axes mean the dimensions to perform the transform on. Default is to perform on
  all axes.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor. The FFT length for each dimension.
    axes: A `Tensor` of type `int32`.
      An int32 tensor with a same shape as fft_length. Axes to perform the transform.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  FFTNDNr   r   r   r   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_fftndrk   fftnd_eager_fallbackr'   rm   rn   ro   r   r   rp   rq   rr   r(   r)   r*   r+   rs   r,   r-   r   r   r   r   r/   r0   r1   r2   r3   r4   r5   r6   r7   s                r8   r   r   j  s>   : 
			0h..0$#\\11gtUJ6gn. $	
D$($0Gn$n

)::u$TKAq#x QK'""$#,,Z89F::Lvw0('	.[ && -
##At,,## 
%*dD
*D2g		&!
T$8 8## 
z" ""2t%JT!%'g 
	..<<	<" Z	  
  
T*4#%
G i,,:::n	
P    C, 7G ,D3?DD32D37E! E! !G7AGGAH+)H+zraw_ops.FFTNDc                    t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } t        j                  |t        j                        }t        j                  |t        j                        }| ||g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   FFTNDr<   r=   r   r*   rw   rA   rB   rx   r#   r@   int32r   r+   r-   	r   r   r   r   r   rz   r7   r6   r1   s	            r8   r   r     s    %<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5%%j'--@*			gmm	4$T*,'&XqV!$41'""$vw0('	.rD   TV_IFFT_Tcomplexsignal.ifft)r   spectral.ifftifftr   r   c           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)ao  Inverse fast Fourier transform.

  Computes the inverse 1-dimensional discrete Fourier transform over the
  inner-most dimension of `input`.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  IFFTNr   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_ifftrk   ifft_eager_fallbackr'   rm   rn   ro   r   r   rp   rq   rr   r(   r)   r*   r+   rs   r,   r-   r.   s              r8   r   r     s   $ 
			0h..0$#\\11fdE#gn, #	Gn$n	
)::e$(Aq#x QK'""$#,,Z89F::Lfg/('	.W && -
##At,,## 
$$.$ g		& 
d& &## 
z" """dT2g 
	..<<	<  Z	  
  
Du40
G i,,:::n	
rt   zraw_ops.IFFTc                 >   t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } | g}d|f}t        j
                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   IFFTr<   r=   r   rv   ry   s          r8   r   r     s    %<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5,'&WaF!$41'""$fg/('	.rD   TV_IFFT2D_Tcomplexsignal.ifft2d)r   spectral.ifft2difft2dr   r   c           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)au  Inverse 2D fast Fourier transform.

  Computes the inverse 2-dimensional discrete Fourier transform over the
  inner-most 2 dimensions of `input`.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  IFFT2DNr   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_ifft2drk   ifft2d_eager_fallbackr'   rm   rn   ro   r   r   rp   rq   rr   r(   r)   r*   r+   rs   r,   r-   r.   s              r8   r   r   +     $ 
			0h..0$#\\11he%gn, %	Gn$n	
)::D*Aq#x QK'""$#,,Z89F::L,1('	.W && -
##At,,## 
&$.$ g		&"
d& &## 
z" ""B5t4g 
	..<<	<  Z	  
  
"dT2
G i,,:::n	
rt   zraw_ops.IFFT2Dc                 >   t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } | g}d|f}t        j
                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   IFFT2Dr<   r=   r   rv   ry   s          r8   r   r   u      %<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5,'&Y,f!$41'""$,1('	.rD   TV_IFFT3D_Tcomplexsignal.ifft3d)r   spectral.ifft3difft3dr   r   c           	      >   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        | |fd      }|t        ur|S 	 t/        j0                  d| |      \  }}}}|dd }t3        j4                         r7d|j7                  d      f}	|j8                  }
t3        j:                  d|
|	|       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |fd      }|t        ur|S t        | ||      S # t        j                  $ r Y t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rH t#        j$                  t&        dt)        | |            }|t"        j*                  j,                  ur|cY S  w xY w)au  Inverse 3D fast Fourier transform.

  Computes the inverse 3-dimensional discrete Fourier transform over the
  inner-most 3 dimensions of `input`.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  IFFT3DNr   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_ifft3drk   ifft3d_eager_fallbackr'   rm   rn   ro   r   r   rp   rq   rr   r(   r)   r*   r+   rs   r,   r-   r.   s              r8   r   r     r   rt   zraw_ops.IFFT3Dc                 >   t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } | g}d|f}t        j
                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   IFFT3Dr<   r=   r   rv   ry   s          r8   r   r     r   rD   TV_IFFTND_Tcomplexifftndc                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||      }|S t        | |||fd      }|t        ur|S 	 t/        j0                  d| |||      \  }}}	}
|
dd }t3        j4                         r7d|	j7                  d      f}|	j8                  }t3        j:                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||fd      }|t        ur|S t        | ||||      S # t        j                  $ r Y t        t         f$ rJ t#        j$                  t&        dt)        | |||            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rJ t#        j$                  t&        dt)        | |||            }|t"        j*                  j,                  ur|cY S  w xY w)a  ND inverse fast Fourier transform.

  Computes the n-dimensional inverse discrete Fourier transform over designated
  dimensions of `input`. The designated dimensions of `input` are assumed to be
  the result of `IFFTND`.

  If fft_length[i]<shape(input)[i], the input is cropped. If
  fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length
  is not given, the default shape(input) is used.

  Axes mean the dimensions to perform the transform on. Default is to perform on
  all axes.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor. The FFT length for each dimension.
    axes: A `Tensor` of type `int32`.
      An int32 tensor with a same shape as fft_length. Axes to perform the transform.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  IFFTNDNr   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_ifftndrk   ifftnd_eager_fallbackr'   rm   rn   ro   r   r   rp   rq   rr   r(   r)   r*   r+   rs   r,   r-   r   s                r8   r   r     s>   : 
			0h..0$#\\11heZ7gn. %	
D$($0Gn$n

)::*4dLAq#x QK'""$#,,Z89F::L,1('	.[ && -
##At,,## 
&*dD
*D2g		&"
T$8 8## 
z" ""B5Zd"&(g 
	..<<	<" Z	  
  
"d:D $&
G i,,:::n	
r   zraw_ops.IFFTNDc                    t        j                  | g|t        j                  t        j                  gt        j                        \  }\  } t        j                  |t        j                        }t        j                  |t        j                        }| ||g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   s   IFFTNDr<   r=   r   r   r   s	            r8   r   r   4  s    %<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5%%j'--@*			gmm	4$T*,'&Y,f!$41'""$,1('	.rD   TV_IRFFT_Trealz_atypes.Float32z_atypes.Float64TV_IRFFT_TcomplexTrealc           	          t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |t        j                  }t        j                   |d      }t#        j$                  d| |||      \  }}}	}
|
dd }t        j&                         rHd|	j)                  d      d|	j)                  d      f}|	j*                  }t        j,                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Inverse real-valued fast Fourier transform.

  Computes the inverse 1-dimensional discrete Fourier transform of a real-valued
  signal over the inner-most dimension of `input`.

  The inner-most dimension of `input` is assumed to be the result of `RFFT`: the
  `fft_length / 2 + 1` unique components of the DFT of a real-valued signal. If
  `fft_length` is not provided, it is computed from the size of the inner-most
  dimension of `input` (`fft_length = 2 * (inner - 1)`). If the FFT length used to
  compute `input` is odd, it should be provided since it cannot be inferred
  properly.

  Along the axis `IRFFT` is computed on, if `fft_length / 2 + 1` is smaller
  than the corresponding dimension of `input`, the dimension is cropped. If it is
  larger, the dimension is padded with zeros.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor of shape [1]. The FFT length.
    Treal: An optional `tf.DType` from: `tf.float32, tf.float64`. Defaults to `tf.float32`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Treal`.
  IRFFTr   Nr   r   r   r   r   r   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   irfft_eager_fallbackr'   rA   float32r*   	make_typer(   r)   r+   rs   r,   r-   r   r   r   r   r/   r0   r1   r2   r3   r4   r5   r6   r7   s                r8   irfftr   F  sy   8 
			0h..0$#\\11gtUJ@gn ]OOE


UG
,%'88u5tM!QXQK'""$s))'2J  ,.F::Lvw0('	./ && -
##At,,## 
!
5t? ?## 
0    D ED99EEE& &E=<E=zraw_ops.IRFFTc                    |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   ri   s   IRFFTr<   r=   r   rA   r   r*   r   rw   rB   rx   r#   r@   r   r   r+   r-   	r   r   r   r   r   rz   r7   r6   r1   s	            r8   r   r     s    
]OOE


UG
,%%<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5%%j'--@*$,UJ7&XqV!$41'""$vw0('	.rD   TV_IRFFT2D_TrealTV_IRFFT2D_Tcomplexc           	          t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |t        j                  }t        j                   |d      }t#        j$                  d| |||      \  }}}	}
|
dd }t        j&                         rHd|	j)                  d      d|	j)                  d      f}|	j*                  }t        j,                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Inverse 2D real-valued fast Fourier transform.

  Computes the inverse 2-dimensional discrete Fourier transform of a real-valued
  signal over the inner-most 2 dimensions of `input`.

  The inner-most 2 dimensions of `input` are assumed to be the result of `RFFT2D`:
  The inner-most dimension contains the `fft_length / 2 + 1` unique components of
  the DFT of a real-valued signal. If `fft_length` is not provided, it is computed
  from the size of the inner-most 2 dimensions of `input`. If the FFT length used
  to compute `input` is odd, it should be provided since it cannot be inferred
  properly.

  Along each axis `IRFFT2D` is computed on, if `fft_length` (or
  `fft_length / 2 + 1` for the inner-most dimension) is smaller than the
  corresponding dimension of `input`, the dimension is cropped. If it is larger,
  the dimension is padded with zeros.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor of shape [2]. The FFT length for each dimension.
    Treal: An optional `tf.DType` from: `tf.float32, tf.float64`. Defaults to `tf.float32`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Treal`.
  IRFFT2Dr   Nr   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   irfft2d_eager_fallbackr'   rA   r   r*   r   r(   r)   r+   rs   r,   r-   r   s                r8   irfft2dr     y   : 
			0h..0$#\\11iuj'5Bgn ]OOE


UG
,%'88:UO!QXQK'""$s))'2J  ,.F::L<2('	./ && -
##At,,## 
#
5t? ?## 
r   zraw_ops.IRFFT2Dc                    |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   ri   s   IRFFT2Dr<   r=   r   r   r   s	            r8   r   r         
]OOE


UG
,%%<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5%%j'--@*$,UJ7&Z<v!$41'""$<2('	.rD   TV_IRFFT3D_TrealTV_IRFFT3D_Tcomplexc           	          t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |t        j                  }t        j                   |d      }t#        j$                  d| |||      \  }}}	}
|
dd }t        j&                         rHd|	j)                  d      d|	j)                  d      f}|	j*                  }t        j,                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Inverse 3D real-valued fast Fourier transform.

  Computes the inverse 3-dimensional discrete Fourier transform of a real-valued
  signal over the inner-most 3 dimensions of `input`.

  The inner-most 3 dimensions of `input` are assumed to be the result of `RFFT3D`:
  The inner-most dimension contains the `fft_length / 2 + 1` unique components of
  the DFT of a real-valued signal. If `fft_length` is not provided, it is computed
  from the size of the inner-most 3 dimensions of `input`. If the FFT length used
  to compute `input` is odd, it should be provided since it cannot be inferred
  properly.

  Along each axis `IRFFT3D` is computed on, if `fft_length` (or
  `fft_length / 2 + 1` for the inner-most dimension) is smaller than the
  corresponding dimension of `input`, the dimension is cropped. If it is larger,
  the dimension is padded with zeros.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor of shape [3]. The FFT length for each dimension.
    Treal: An optional `tf.DType` from: `tf.float32, tf.float64`. Defaults to `tf.float32`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Treal`.
  IRFFT3Dr   Nr   r   ri   )r   r   r   r   r   r    r!   r"   r#   r$   r%   irfft3d_eager_fallbackr'   rA   r   r*   r   r(   r)   r+   rs   r,   r-   r   s                r8   irfft3dr     r   r   zraw_ops.IRFFT3Dc                    |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   ri   s   IRFFT3Dr<   r=   r   r   r   s	            r8   r   r   -  r   rD   TV_IRFFTND_TrealTV_IRFFTND_Tcomplexirfftndc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||d|      }|S t        | ||||fd      }|t        ur|S |t.        j0                  }t3        j4                  |d      }	 t7        j8                  d| ||||      \  }	}	}
}|dd }t3        j:                         rHd|
j=                  d      d|
j=                  d      f}|
j>                  }t3        j@                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||fd      }|t        ur|S t        | |||||      S # t        j                  $ r Y =t        t         f$ rK t#        j$                  t&        dt)        | ||||            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rK t#        j$                  t&        dt)        | ||||            }|t"        j*                  j,                  ur|cY S  w xY w)a  ND inverse real fast Fourier transform.

  Computes the n-dimensional inverse real discrete Fourier transform over
  designated dimensions of `input`. The designated dimensions of `input` are
  assumed to be the result of `IRFFTND`. The inner-most dimension contains the
  `fft_length / 2 + 1` unique components of the DFT of a real-valued signal. 

  If fft_length[i]<shape(input)[i], the input is cropped. If
  fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length
  is not given, the default shape(input) is used.

  Axes mean the dimensions to perform the transform on. Default is to perform on
  all axes.

  Args:
    input: A `Tensor`. Must be one of the following types: `complex64`, `complex128`.
      A complex tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor. The FFT length for each dimension.
    axes: A `Tensor` of type `int32`.
      An int32 tensor with a same shape as fft_length. Axes to perform the transform.
    Treal: An optional `tf.DType` from: `tf.float32, tf.float64`. Defaults to `tf.float32`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Treal`.
  IRFFTNDr   Nr   r   )r   r   r   r   r   ri   )!r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_irfftndrk   irfftnd_eager_fallbackr'   rm   rn   ro   r   r   rp   rq   rr   rA   r   r*   r   r(   r)   r+   rs   r,   r-   )r   r   r   r   r   r/   r0   r1   r2   r3   r4   r5   r6   r7   s                 r8   r   r   A  s   > 
			0h..0$#\\11iuj$Hgn. &	
D%/7Gn$n
]OOE


UG
,%
):::DAq#x QK'""$s))'2J  ,.F::L<2('	.e && -
##At,,## 
'*dE4
149g		&#
TTtE E## 
z" ""REjt$)6g 
	..<<	<* Z	  
  
2t%JT"'d4
G i,,:::n	
P    D) " H )E0<EE0/E04F  F   H6AHHAI,*I,zraw_ops.IRFFTNDc                 &   |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }t        j                  |t         j                        }| ||g}d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S )Nr   ri   s   IRFFTNDr<   r=   r   r   )
r   r   r   r   r   r   rz   r7   r6   r1   s
             r8   r   r     s    
]OOE


UG
,%%<<eWcGL]L]_f_q_qKtv}  wH  wH  I.(5%%j'--@*			gmm	4$T*,UJ7&Z<v!$41'""$<2('	.rD   TV_RFFT_TrealTV_RFFT_Tcomplexri   c           	          t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |t        j                  }t        j                   |d      }t#        j$                  d| |||      \  }}}	}
|
dd }t        j&                         rHd|	j)                  d      d|	j)                  d      f}|	j*                  }t        j,                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a  Real-valued fast Fourier transform.

  Computes the 1-dimensional discrete Fourier transform of a real-valued signal
  over the inner-most dimension of `input`.

  Since the DFT of a real signal is Hermitian-symmetric, `RFFT` only returns the
  `fft_length / 2 + 1` unique components of the FFT: the zero-frequency term,
  followed by the `fft_length / 2` positive-frequency terms.

  Along the axis `RFFT` is computed on, if `fft_length` is smaller than the
  corresponding dimension of `input`, the dimension is cropped. If it is larger,
  the dimension is padded with zeros.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`.
      A float32 tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor of shape [1]. The FFT length.
    Tcomplex: An optional `tf.DType` from: `tf.complex64, tf.complex128`. Defaults to `tf.complex64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Tcomplex`.
  RFFTri   Nri   r   r   r   r   ri   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   rfft_eager_fallbackr'   rA   rB   r*   r   r(   r)   r+   rs   r,   r-   r   r   ri   r   r/   r0   r1   r2   r3   r4   r5   r6   r7   s                r8   rfftr     s   2 
			0h..0$#\\11fdE:z8Egn   H*5('88e
X!QX QK'""$s))'2J  ,.F::Lfg/('	.1 && -
##At,,## 
 
hTtE E## 
r   zraw_ops.RFFTc                    |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   r   s   RFFTr<   r=   r   rA   rB   r*   r   rw   r   float64r#   r@   r   r   r+   r-   	r   r   ri   r   r   _attr_Trealr7   r6   r1   s	            r8   r   r     s      H*5("995'3ZaZiZiHlnun}n}~+x%%j'--@*$,[*h7&WaF!$41'""$fg/('	.rD   TV_RFFT2D_TrealTV_RFFT2D_Tcomplexc           	          t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |t        j                  }t        j                   |d      }t#        j$                  d| |||      \  }}}	}
|
dd }t        j&                         rHd|	j)                  d      d|	j)                  d      f}|	j*                  }t        j,                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a#  2D real-valued fast Fourier transform.

  Computes the 2-dimensional discrete Fourier transform of a real-valued signal
  over the inner-most 2 dimensions of `input`.

  Since the DFT of a real signal is Hermitian-symmetric, `RFFT2D` only returns the
  `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension
  of `output`: the zero-frequency term, followed by the `fft_length / 2`
  positive-frequency terms.

  Along each axis `RFFT2D` is computed on, if `fft_length` is smaller than the
  corresponding dimension of `input`, the dimension is cropped. If it is larger,
  the dimension is padded with zeros.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`.
      A float32 tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor of shape [2]. The FFT length for each dimension.
    Tcomplex: An optional `tf.DType` from: `tf.complex64, tf.complex128`. Defaults to `tf.complex64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Tcomplex`.
  RFFT2Dri   Nr   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   rfft2d_eager_fallbackr'   rA   rB   r*   r   r(   r)   r+   rs   r,   r-   r   s                r8   rfft2dr        4 
			0h..0$#\\11heZXGgn   H*5('88*x!QX QK'""$s))'2J  ,.F::L,1('	.1 && -
##At,,## 
"
hTtE E## 
r   zraw_ops.RFFT2Dc                    |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   r   s   RFFT2Dr<   r=   r   r   r   s	            r8   r   r   C        H*5("995'3ZaZiZiHlnun}n}~+x%%j'--@*$,[*h7&Y,f!$41'""$,1('	.rD   TV_RFFT3D_TrealTV_RFFT3D_Tcomplexc           	          t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S |t        j                  }t        j                   |d      }t#        j$                  d| |||      \  }}}	}
|
dd }t        j&                         rHd|	j)                  d      d|	j)                  d      f}|	j*                  }t        j,                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y w xY w)a#  3D real-valued fast Fourier transform.

  Computes the 3-dimensional discrete Fourier transform of a real-valued signal
  over the inner-most 3 dimensions of `input`.

  Since the DFT of a real signal is Hermitian-symmetric, `RFFT3D` only returns the
  `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension
  of `output`: the zero-frequency term, followed by the `fft_length / 2`
  positive-frequency terms.

  Along each axis `RFFT3D` is computed on, if `fft_length` is smaller than the
  corresponding dimension of `input`, the dimension is cropped. If it is larger,
  the dimension is padded with zeros.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`.
      A float32 tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor of shape [3]. The FFT length for each dimension.
    Tcomplex: An optional `tf.DType` from: `tf.complex64, tf.complex128`. Defaults to `tf.complex64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Tcomplex`.
  RFFT3Dri   Nr   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   rfft3d_eager_fallbackr'   rA   rB   r*   r   r(   r)   r+   rs   r,   r-   r   s                r8   rfft3dr  W  r   r   zraw_ops.RFFT3Dc                    |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nri   r   s   RFFT3Dr<   r=   r  r   r   s	            r8   r  r    r  rD   TV_RFFTND_TrealTV_RFFTND_Tcomplexrfftndc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||d|      }|S t        | ||||fd      }|t        ur|S |t.        j0                  }t3        j4                  |d      }	 t7        j8                  d| ||||      \  }	}	}
}|dd }t3        j:                         rHd|
j=                  d      d|
j=                  d      f}|
j>                  }t3        j@                  d|||       |\  }|S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||fd      }|t        ur|S t        | |||||      S # t        j                  $ r Y =t        t         f$ rK t#        j$                  t&        dt)        | ||||            }|t"        j*                  j,                  ur|cY S  w xY w# t        t         f$ rK t#        j$                  t&        dt)        | ||||            }|t"        j*                  j,                  ur|cY S  w xY w)aV  ND fast real Fourier transform.

  Computes the n-dimensional real discrete Fourier transform over designated
  dimensions of `input`. The designated dimensions of `input` are assumed to be
  the result of `RFFTND`. The length of the last axis transformed will be
  fft_length[-1]//2+1.

  If fft_length[i]<shape(input)[i], the input is cropped. If
  fft_length[i]>shape(input)[i], the input is padded with zeros. If fft_length
  is not given, the default shape(input) is used.

  Axes mean the dimensions to perform the transform on. Default is to perform on
  all axes.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`.
      A complex tensor.
    fft_length: A `Tensor` of type `int32`.
      An int32 tensor. The FFT length for each dimension.
    axes: A `Tensor` of type `int32`.
      An int32 tensor with a same shape as fft_length. Axes to perform the transform.
    Tcomplex: An optional `tf.DType` from: `tf.complex64, tf.complex128`. Defaults to `tf.complex64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `Tcomplex`.
  RFFTNDri   Nr   r   )r   r   r   ri   r   r   )!r   r   r   r   r   r    r!   r"   r#   r$   r%   _dispatcher_for_rfftndrk   rfftnd_eager_fallbackr'   rm   rn   ro   r   r  rp   rq   rr   rA   rB   r*   r   r(   r)   r+   rs   r,   r-   )r   r   r   ri   r   r/   r0   r1   r2   r3   r4   r5   r6   r7   s                 r8   r  r    s   > 
			0h..0$#\\11heZz8Mgn. %	
D(D2D:Gn$n  H*5(
)::*4#$0Aq#x QK'""$s))'2J  ,.F::L,1('	.e && -
##At,,## 
&*dHd
4d<g		&"
TH4TK K## 
z" ""B5Zd&.T;g 
	..<<	<* Z	  
  
"d:D$,49
G i,,:::n	
r   zraw_ops.RFFTNDc                 &   |t         j                  }t        j                  |d      }t        j                  | g|t         j
                  t         j                  gt         j
                        \  }\  } t        j                  |t         j                        }t        j                  |t         j                        }| ||g}d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S )Nri   r   s   RFFTNDr<   r=   r  r   )
r   r   r   ri   r   r   r   r7   r6   r1   s
             r8   r  r    s      H*5("995'3ZaZiZiHlnun}n}~+x%%j'--@*			gmm	4$T*,[*h7&Y,f!$41'""$,1('	.rD   )N)__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r   r   r!   r   r*   tensorflow.python.frameworkr   rA   tensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   r#   r   r(   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   ro    tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   	Complex64r9   	to_raw_opr   r&   rH   rF   rG   rO   rM   rN   rT   rR   rS   rY   rW   rX   r`   r^   r_   rb   add_fallback_dispatch_listadd_type_based_api_dispatcherre   rh   _tf_type_based_dispatcherDispatchrj   rl   r{   r~   r   r   r   r   r   r   r   r   r   Int32r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rB   r   r   r   r   r   r   r   r   r  r  r  r  r  r	  r
  r  r  r  r  r   rD   r8   <module>r%     s  
  6 7 1 7 9 F K 3 I C 8 6 % % '$YsG$5$556 $iPSU\UfUfPfFg $L )9'(	)BC
Ic73D3D.D$E 
U^_bdkdudu_uUv 
$yg&7&7!78 $	RUW^WhWhRhHi $L -Y+,^T^^K-HI

iW5F5F0F&G 
W`adfmfwfwawWx 
$yg&7&7!78 $	RUW^WhWhRhHi $L -Y+,^T^^K-HI

iW5F5F0F&G 
W`adfmfwfwawWx 
$iW%6%6 67 $yQTV]VgVgQgGh $L +I)*>4>>*+EF	
YsG4E4E/E%F 
V_`celevev`vVw 
$	#w'8'8"89 $SVX_XiXiSiIj $L /i-.~t~~l/KL
yg6G6G1G'H 
XabegngxgxbxXy 
$	#w'8'8"89 $SVX_XiXiSiIj $L /i-.~t~~l/KL
yg6G6G1G'H 
XabegngxgxbxXy 
 +-ACVW
%%
((
<ABne,@yo-. @i_H\>] @ - C ) &@D i~t~~c2333<< 
i_(<= 
YWZ\kWkMl 
 /1EGZ[ 
%%
((
>IJ&0@3 112 @)CQbLbBc @ 1 K ) &@D 	#	/">4>>%#8977@@ 
	#/@*@ A 
QZ[^`q[qQr 
 /1EGZ[ 
%%
((
>IJ&0@3 112 @)CQbLbBc @ 1 K ) &@D 	#	/">4>>%#8977@@ 
	#/@*@ A 
QZ[^`q[qQr 
 /1EGZ[ 
%%
((
7N3 112 N	#w}}J\@] Nenort{  uB  uB  pB  fC N  S\  ]`  bs  ]s  St N  ) &N` 	#	/">4>>%#8977@@ 	#/@*@ A yY\^e^k^kYkOl t}  B  DK  DQ  DQ  Q  uR   bk  lo  qB  lB  bC  -/CEXY 
%%
((
=EFov.@	#//0 @	#O_J_@` @ / G ) &@D !y !5655>> 
y.>)>? 
yY\^nYnOo 
 13GI\] 
%%
((
?MN'2@)C!334 @IcSeNeDf @ 3 O ) &@D 
%#	$^T^^F%;	<99BB 
30B+B!C 
S\]`bt]tSu 
 13GI\] 
%%
((
?MN'2@)C!334 @IcSeNeDf @ 3 O ) &@D 
%#	$^T^^F%;	<99BB 
30B+B!C 
S\]`bt]tSu 
 13GI\] 
%%
((
8N)C!334 N)CQXQ^Q^L^B_ Ngpqtv}  wD  wD  rD  hE N  U^  _b  dv  _v  Uw N  ) &N` 
%#	$^T^^F%;	<99BB 30B+B!C QZ[^`g`m`m[mQn v  AD  FM  FS  FS  AS  wT   dm  nq  sE  nE  dF  )+<>OP/1EGZ[ t{  uD  uD  KO :3 112 :	#w}}J\@] :es :  T]  ^a  cq  ^q  Tr :x 	#	/">4>>%#89	#/@*@ A yY\^e^k^kYkOl   vD   T]  ^a  cq  ^q  Tr " -/@BST 35IK^_  {B  {J  {J  QU ;9S"556 ;IcSZS`S`N`Da ;iy ;  Zc  dg  iy  dy  Zz ;z ')%
&~t~~g'>
?)C1D,D"E S\]`bibobo]oSp   zJ   Zc  dg  iy  dy  Zz " -/@BST 35IK^_  {B  {J  {J  QU ;9S"556 ;IcSZS`S`N`Da ;iy ;  Zc  dg  iy  dy  Zz ;z ')%
&~t~~g'>
?)C1D,D"E S\]`bibobo]oSp   zJ   Zc  dg  iy  dy  Zz " -/@BST 35IK^_ 
%%
((
9 `g  `o  `o  vz U9S"556 UIcSZS`S`N`Da Uirsvx  yF  yF  tF  jG U  O_ U  H  IL  N^  I^  _ U  ) &Un ')%
&~t~~g'>
?!;;DD )C1D,D"E S\]`bibobo]oSp   yB  CF  HO  HU  HU  CU  yV   _o   H  IL  N^  I^  _ $ ):<MN-/CEXY t{  uF  uF  MQ 8	#},- 89S'--EW;X 8cs 8  V_  `c  eu  `u  Vv 8t !y !56ym);< )TWY`YfYfTfJg   tD   T]  ^a  cs  ^s  Tt " +->@QR13GI\]  {B  {L  {L  SW 9)C01 9ygmmI[?\ 9gy 9  \e  fi  k}  f}  \~ 9v 
%#	$^T^^F%;	<3+?!@ iX[]d]j]jXjNk   xJ   Zc  dg  i{  d{  Z| " +->@QR13GI\]  {B  {L  {L  SW 9)C01 9ygmmI[?\ 9gy 9  \e  fi  k}  f}  \~ 9v 
%#	$^T^^F%;	<3+?!@ iX[]d]j]jXjNk   xJ   Zc  dg  i{  d{  Z| " +->@QR13GI\] 
%%
((
8 `g  `q  `q  x| U)C01 UygmmI[?\ Udmnqsz  tA  tA  oA  eB U  M_ U  AJ  KN  Pb  Kb  Ac U  ) &Un 
%#	$^T^^F%;	<99BB 3+?!@ iX[]d]j]jXjNk s|  ~A  CJ  CP  CP  ~P  tQ   ]o   H  IL  N`  I`  a rD   