o
    +ѹg
                     @  s  d dl mZ d dlZd dlZddlmZmZ ddlmZm	Z	 dd Z
e	e
d2d3ddZe	e
d2d3ddZe	e
d2d3ddZe	e
d2d3ddZe	e
d4d3ddZe	e
d4d3ddZe	e
d4d3ddZe	e
d4d3ddZe	e
d5d3ddZe	e
d5d3ddZe	e
d5d3d d!Ze	e
d5d3d"d#Ze	e
d2d3d$d%Ze	e
d2d3d&d'Ze	d6d)d*Ze	d6d+d,Ze	d7d8d.d/Ze	d7d8d0d1ZdS )9    )annotationsN   )_dtypes_impl_util)	ArrayLike
normalizerc                   s   t   fdd}|S )z>NumPy fft casts inputs to 64 bit and *returns 64-bit results*.c                   s>   |   r	t jnt j}t| |}  | g|R i |S N)Z
is_complexr   Zdefault_dtypesZcomplex_dtypeZfloat_dtyper   Zcast_if_needed)ZtensorargskwdsZtarget_dtypefunc T/Users/admin/.pyenv/versions/3.10.0/lib/python3.10/site-packages/torch/_numpy/fft.pywrapped   s   zupcast.<locals>.wrappedN)	functoolswraps)r   r   r   r   r   upcast   s   	r   ar   c                 C  s   t jj| |||dS N)Zdimnorm)torchfftr   nZaxisr   r   r   r   r         r   c                 C     t jj| |||dS r   )r   r   ifftr   r   r   r   r   !   r   r   c                 C  r   r   )r   r   rfftr   r   r   r   r   '   r   r   c                 C  r   r   )r   r   irfftr   r   r   r   r   -   r   r   c                 C  r   r   )r   r   fftnr   saxesr   r   r   r   r    3   r   r    c                 C  r   r   )r   r   ifftnr!   r   r   r   r$   9   r   r$   c                 C  r   r   )r   r   rfftnr!   r   r   r   r%   ?   r   r%   c                 C  r   r   )r   r   irfftnr!   r   r   r   r&   E   r   r&   r   c                 C  r   r   )r   r   fft2r!   r   r   r   r)   K   r   r)   c                 C  r   r   )r   r   ifft2r!   r   r   r   r*   Q   r   r*   c                 C  r   r   )r   r   rfft2r!   r   r   r   r+   W   r   r+   c                 C  r   r   )r   r   irfft2r!   r   r   r   r,   ]   r   r,   c                 C  r   r   )r   r   hfftr   r   r   r   r-   c   r   r-   c                 C  r   r   )r   r   ihfftr   r   r   r   r.   i   r   r.         ?c                 C     t j| |S r   )r   r   fftfreqr   dr   r   r   r1   o      r1   c                 C  r0   r   )r   r   rfftfreqr2   r   r   r   r5   t   r4   r5   xc                 C  r0   r   )r   r   fftshiftr6   r#   r   r   r   r7   y   r4   r7   c                 C  r0   r   )r   r   	ifftshiftr8   r   r   r   r9   ~   r4   r9   )Nr   N)r   r   )NNN)Nr'   N)r/   r   )r6   r   )
__future__r   r   r    r   r   Z_normalizationsr   r   r   r   r   r   r   r    r$   r%   r&   r)   r*   r+   r,   r-   r.   r1   r5   r7   r9   r   r   r   r   <module>   sp    