+
    i                         ^ RI t^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ R	IHtHt ^ RIt]! R
4      t ! R R]]4      tR tR# )    N)version_tuple)Iterable)Mul)S)Sqrt)import_module)
PRECEDENCE)AbstractPythonCodePrinterArrayPrinter
tensorflowc                     a a ] tR t^t oRtRt/ ]P                  Rb]P                  Rb]P                  Rb]P                  Rb]P                  Rb]P                  Rb]R	b]P                  R
b]P                  Rb]P                   Rb]P"                  Rb]P$                  Rb]P&                  Rb]P(                  Rb]P*                  Rb]P,                  Rb]P.                  Rb/ ]P0                  Rb]P2                  Rb]P4                  Rb]P6                  Rb]P8                  Rb]P:                  Rb]P<                  Rb]P>                  Rb]P@                  Rb]PB                  Rb]PD                  Rb]PF                  Rb]PH                  R b]PJ                  R!b]PL                  R"b]PN                  R#b]PP                  R$bC]PR                  R%]PT                  R&]PV                  R']PX                  R(]PZ                  R)]P\                  R*/Ct/]0! ]1Pd                  R+R,7      t2R@V 3R- llt3V 3R. lt4]4t5]4t6]4t7]4t8]4t9]4t:]4t;]4t<]4t=]4t>R/ t?R0 t@R1 tAR2 tBR3 tCR4 tDR5 tER6 tFR7 tGR8 tHR9 tIR:tJR;tKR<tLR=tMR>tNR?tOR,tPVtQV ;tR# )ATensorflowPrinterzx
Tensorflow printer which handles vectorized piecewise functions,
logical operators, max/min, and relational operators.
_tensorflowcodeztensorflow.math.absztensorflow.math.signztensorflow.math.ceilztensorflow.math.floorztensorflow.math.logztensorflow.math.exptensorflow.math.sqrtztensorflow.math.cosztensorflow.math.acosztensorflow.math.sinztensorflow.math.asinztensorflow.math.tanztensorflow.math.atanztensorflow.math.atan2ztensorflow.math.coshztensorflow.math.acoshztensorflow.math.sinhztensorflow.math.asinhztensorflow.math.tanhztensorflow.math.atanhztensorflow.math.realztensorflow.math.imagztensorflow.math.angleztensorflow.math.erfztensorflow.math.lgammaztensorflow.math.equalztensorflow.math.not_equalztensorflow.math.greaterztensorflow.math.lessztensorflow.math.less_equalztensorflow.math.greater_equalztensorflow.math.logical_andztensorflow.math.logical_orztensorflow.math.logical_notztensorflow.math.maximumztensorflow.math.minimumztensorflow.math.addztensorflow.math.multiplyztensorflow.linalg.traceztensorflow.linalg.detN)tensorflow_versionc                   < \         SV `  V4       V P                  R ,          pVf   \        '       d   \        P                  pW n        R# )r   N)super__init__	_settingsr   __version__r   )selfsettingsversion	__class__s   && y/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/printing/tensorflow.pyr   TensorflowPrinter.__init__S   s9    "..!56?zz ,,G")    c                R  < V P                   P                  \        V4      R 4      pVf   \        SV `  V4      # VP
                   Uu. uF  q0P                  V4      NK  	  pp\        V4      ^8X  d!   V P                  V4      : RV^ ,          : R2# V P                  W$4      # u upi )N())
mappinggettyper   _print_Basicargs_printlen_module_format_expand_fold_binary_op)r   expropargchildrenr   s   &&   r   _print_Function!TensorflowPrinter._print_Function[   s    \\d4j$/:7'--04		:	KK$	:x=A##B' 
 ..r<< ;s   B$c                x    V P                  R 4      pRP                  W P                  VP                  4      4      # )ztensorflow.linalg.inv{}({}))r(   formatr&   r,   )r   r*   r+   s   && r   _print_Inverse TensorflowPrinter._print_Inverset   s/      !89r;;txx#899r   c                    V P                   pV'       d,   \        V4      \        R 4      8  d   V P                  R4      pMV P                  R4      pRP                  W0P	                  VP
                  4      4      # )z1.14ztensorflow.matrix_transposez"tensorflow.linalg.matrix_transposer1   )r   r   r(   r2   r&   r,   )r   r*   r   r+   s   &&  r   _print_Transpose"TensorflowPrinter._print_Transposex   s_    ))}W-f0EE$$%BCB$$%IJBr;;txx#899r   c                   a a VP                   p\        ;QJ d    R  V 4       F  '       g   K   RM	  RM! R  V 4       4      '       d   \        R4      hV V3R loS! VP                  V4      # )c              3   B   "   T F  p\        V\        4      x  K  	  R # 5iN)
isinstancer   ).0is   & r   	<genexpr>6TensorflowPrinter._print_Derivative.<locals>.<genexpr>   s     :	1z!X&&	s   TFz1derivation by multiple variables is not supportedc                    < V'       g   SP                  V 4      # SP                  R 4      : RS! WRR 4      : RSP                  VR,          4      : R2# )ztensorflow.gradientsr   N, z)[0])r&   r(   )r*   r%   r   unfolds   &&r   rC   3TensorflowPrinter._print_Derivative.<locals>.unfold   sL    {{4((''(>?4cr+KKR) r   )	variablesanyNotImplementedErrorr*   )r   r*   rE   rC   s   f& @r   _print_Derivative#TensorflowPrinter._print_Derivative   sQ    NN	3:	:333:	:::%&YZZ	 dii++r   c                0   V P                   pV'       d   \        V4      \        R 4      8  d   RpMRp^ RIHp VP                  ^ ,          P                  w  rV\        VP                  4      ^8X  dB   RP                  V P                  V4      V P                  V4      V P                  V4      ^ 4      # RP                  V P                  V4      V P                  V4      V P                  V4      V P                  V! VP                  R,          !  4      4      # )z1.0ztensorflow.selectztensorflow.where)	Piecewisez{}({}, {}, {}):   NN)	r   r   $sympy.functions.elementary.piecewiserK   r%   r'   r2   r(   r&   )r   r*   r   tensorflow_piecewiserK   econds   &&     r   _print_Piecewise"TensorflowPrinter._print_Piecewise   s    ))}W-e0DD#6 #5 B))A,##tyy>Q#**##$89D!A	   && 45KKKKNKK	499R=12	4 	4r   c                <   VP                   w  r#VP                  \        P                  8X  d1   R P	                  V P                  R4      V P                  V4      4      # RP	                  V P                  R4      V P                  V4      V P                  V4      4      # )r1   r   z
{}({}, {})ztensorflow.math.pow)r%   expr   Halfr2   r(   r&   )r   r*   baserT   s   &&  r   
_print_PowTensorflowPrinter._print_Pow   s     II	88qvv??##$:;T[[=NP P"" 56KKt{{3/1 	1r   c                j   VP                   '       d   R MRpRRP                  VP                  4        UUu. uF@  pRRP                  V Uu. uF  q@P                  V4      NK  	  up4      ,           R,           NKB  	  upp4      ,           R,           pV P	                  V4      : RV: R2# u upi u uppi )ztensorflow.Variableztensorflow.constant[rA   ]r   r    )free_symbolsjointolistr&   r(   )r   r*   tensorflow_fr=   jdatas   &&    r   _print_MatrixBase#TensorflowPrinter._print_MatrixBase   s    040A0A0A,G\499VZVaVaVcdVcQRc$))Q,GQ[[^Q,G"HHLLVcdeefii-
 	
 -Hds   B/B*$B/*B/c                   ^ RI Hp VP                   Uu. uF  p\        W24      '       g   K  VNK  	  ppVP                   Uu. uF  q3V9  g   K  VNK  	  ppV'       dI   V P	                  \
        P                  ! V4      \        R,          4      : RV P                  RV4      : 2# V P                  RV4      # u upi u upi )r   )
MatrixExprr   *tensorflow.linalg.matmul)	sympy.matrices.expressionsre   r%   r;   parenthesizer   fromiterr	   r)   )r   r*   re   r,   mat_argsr%   s   &&    r   _print_MatMulTensorflowPrinter._print_MatMul   s    9#'99L9C
30KCC9L#yy@yx,?y@!!#,,t"4j6GH++.:  ..*H6 6 M@s   B:B:B?B?c                ^    V P                  R VP                  .VP                  ,          4      # )rg   )r)   rV   rT   )r   r*   s   &&r   _print_MatPowTensorflowPrinter._print_MatPow   s)    **&DHH(<> 	>r   c                    . pVP                    F#  pVP                  V P                  V4      4       K%  	  R P                  V4      # )
)r%   appendr&   r]   )r   r*   retsubexprs   &&  r   _print_CodeBlock"TensorflowPrinter._print_CodeBlock   s8    yyGJJt{{7+, !yy~r   c                >    R V P                   ! VP                  !   R2# )ztensorflow.math.is_nan(r    r&   r%   r   rT   s   &&r   _print_isnanTensorflowPrinter._print_isnan       (chh)?(@BBr   c                >    R V P                   ! VP                  !   R2# )ztensorflow.math.is_inf(r    ry   rz   s   &&r   _print_isinfTensorflowPrinter._print_isinf   r}   r   r   zlinalg.einsumzmath.add	transposeoneszerosr:   )S__name__
__module____qualname____firstlineno____doc__printmethodsympyAbssignceilingfloorlogrT   r   cosacossinasintanatanatan2coshacoshsinhasinhtanhatanhreimr,   erfloggammaEqNeStrictGreaterThanStrictLessThanLessThanGreaterThanAndOrNotMaxMinMatAddHadamardProductTraceDeterminantr!   dictr
   _default_settingsr   r.   _print_Expr_print_Application_print_MatrixExpr_print_Relational
_print_Not
_print_And	_print_Or_print_HadamardProduct_print_Trace_print_Determinantr3   r6   rH   rQ   rW   rb   rl   ro   rv   r{   r   _module_einsum_add
_transpose_ones_zeros__static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      so     $K5		(5

*5
 	-5 	,5 			(5 			(5 	$5 			(5 	

*5 			(5 	

*5 			(5 	

*5  	,!5$ 	

*%5& 	,'5( 	

*)5* 	,+5, 	

*-5. 	,/52 	(354 	(556 			*75< 			(=5> 	0?5B 	)C5D 	-E5F 	!:G5H 	4I5J 	4K5L 	:M5P 			0Q5R 	.S5T 			0U5V 			,		, 	+9. 	3i5Gn !33
*= "K('' J JI,"L(::,4,	1
6>CC GGDJEFFr   r   c                 :    \        V4      pVP                  V 4      # r:   )r   doprint)r*   r   printers   &, r   tensorflow_coder      s    )G??4  r   )sympy.codegenr   sympy.codegen.cfunctionssympy.external.importtoolsr   collections.abcr   sympy.core.mulr   sympy.core.singletonr   r   sympy.externalr   sympy.printing.precedencer	   sympy.printing.pycoder
   r   r   r   r    r   r   <module>r      sG      4 $  " ) ( 0 I <(
K&? K\!r   