o
    i 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   linop r   a/var/www/myenv/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)num_rows
multiplierr   r   r   r   )r   dtype
is_complexr   conjr
   LinearOperatorScaledIdentity	_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   )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   adjoint.0r   r   r   r   
<listcomp>Y       z'_adjoint_block_diag.<locals>.<listcomp>T	operatorsr   r   r   r   )r   LinearOperatorBlockDiagr2   r   r   r   )block_diag_operatorr   r   r   _adjoint_block_diagT   s   r5   c                 C   r)   )Nc                 S   r*   r   r+   r-   r   r   r   r/   g   r0   z&_adjoint_kronecker.<locals>.<listcomp>Tr1   )r   LinearOperatorKroneckerr2   r   r   r   )kronecker_operatorr   r   r   _adjoint_kroneckera   s   r8   c                 C   s2   | j }|jjrt|}| j|| j| j| jddS )NT)spectrumr   r   r   r   )	r9   r   r    r   r!   	__class__r   r   r   )circulant_operatorr9   r   r   r   _adjoint_circulanto   s   
r<   c                 C   r   r   r   )householder_operatorr   r   r   _adjoint_householder   r   r>   N) __doc__tensorflow.python.opsr   tensorflow.python.ops.linalgr   r   r   r   r   r   r	   r
   r   RegisterAdjointLinearOperatorr   r   r   LinearOperatorIdentityr   r"   r$   r&   r(   r3   r5   r6   r8   _BaseLinearOperatorCirculantr<   LinearOperatorHouseholderr>   r   r   r   r   <module>   sZ   

	






