o
    ?en                     @   s4  d 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 eejdd Zeejdd Zeejdd Zeejdd Zee	jdd Zeejdd Zeejdd Zeejdd Zee
jdd ZdS )z)Registrations for LinearOperator.adjoint.    )math_ops)linear_operator)linear_operator_adjoint)linear_operator_algebra)linear_operator_block_diag)linear_operator_circulant)linear_operator_diag)linear_operator_householder)linear_operator_identity)linear_operator_kroneckerc                 C   s   t j| | j| j| j| jdS )N)is_non_singularis_self_adjointis_positive_definite	is_square)r   LinearOperatorAdjointr   r   r   r   Zlinop r   s/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/ops/linalg/adjoint_registrations.py_adjoint_linear_operator   s   r   c                 C   s   | j S N)operatorr   r   r   r    _adjoint_adjoint_linear_operator)   s   r   c                 C      | S r   r   )identity_operatorr   r   r   _adjoint_identity/      r   c                 C   s6   | j }|jjrt|}tj| j|| j| j	| j
ddS )NT)Znum_rows
multiplierr   r   r   r   )r   dtype
is_complexr   conjr
   LinearOperatorScaledIdentityZ	_num_rowsr   r   r   )r   r   r   r   r   _adjoint_scaled_identity5   s   
r!   c                 C   s2   | j }|jjrt|}tj|| j| j| j	ddS )NT)diagr   r   r   r   )
r"   r   r   r   r   r   LinearOperatorDiagr   r   r   )Zdiag_operatorr"   r   r   r   _adjoint_diagE   s   
r$   c                 C   &   t jdd | jD | j| j| jddS )Nc                 S      g | ]}|  qS r   Zadjoint.0r   r   r   r   
<listcomp>Y       z'_adjoint_block_diag.<locals>.<listcomp>T	operatorsr   r   r   r   )r   LinearOperatorBlockDiagr-   r   r   r   )Zblock_diag_operatorr   r   r   _adjoint_block_diagT   s   r/   c                 C   r%   )Nc                 S   r&   r   r'   r(   r   r   r   r*   g   r+   z&_adjoint_kronecker.<locals>.<listcomp>Tr,   )r   LinearOperatorKroneckerr-   r   r   r   )Zkronecker_operatorr   r   r   _adjoint_kroneckera   s   r1   c                 C   s2   | j }|jjrt|}| j|| j| j| jddS )NT)spectrumr   r   r   r   )	r2   r   r   r   r   	__class__r   r   r   )Zcirculant_operatorr2   r   r   r   _adjoint_circulanto   s   
r4   c                 C   r   r   r   )Zhouseholder_operatorr   r   r   _adjoint_householder   r   r5   N) __doc__Ztensorflow.python.opsr   Ztensorflow.python.ops.linalgr   r   r   r   r   r   r	   r
   r   ZRegisterAdjointZLinearOperatorr   r   r   ZLinearOperatorIdentityr   r    r!   r#   r$   r.   r/   r0   r1   Z_BaseLinearOperatorCirculantr4   ZLinearOperatorHouseholderr5   r   r   r   r   <module>   sZ   

	






