o
    ?e                     @   sl   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ejdfd	d
ZdS )zOperations for linear algebra.    N)dtypes)ops)tensor)	array_ops)math_ops)compatc                 C   s  t j|d| ||gd |du }|du rg n|}|du r| n|}t| tjs,t|tjr3t| |}n t| tjr?t|tjsIt	d|  d| | |k}t
| |}t|tjs_t|tjrt j|dtjd}tj||gfdd	}|stj|| |gfdd	}nt|}||g }|s|| |g }tj||d
}	|rt|	W  d   S tj||d
}
t|
|	W  d   S 1 sw   Y  dS )zQConstruct an identity matrix, or a batch of matrices.

  See `linalg_ops.eye`.
  eye)default_namevaluesNz[Arguments `num_rows` and `num_columns` must be positive integer values. Received: num_rows=z, num_columns=shape)namedtyper   )Zaxis)r   )r   Z
name_scope
isinstancer   ZTensorr   minimumr   Zintegral_types	TypeErrornpZconvert_to_tensorr   Zint32r   concatlistZonesZmatrix_diagZzerosZmatrix_set_diag)Znum_rowsZnum_columnsZbatch_shaper   r   Z	is_squareZ	diag_sizeZ
diag_shaper   Z	diag_onesZzero_matrix r   f/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/ops/linalg_ops_impl.pyr      sV   	

)
$r   )__doc__numpyr   Ztensorflow.python.frameworkr   r   r   Ztensorflow.python.opsr   r   Ztensorflow.python.utilr   Zfloat32r   r   r   r   r   <module>   s   