
    
Ng                     z    d dl Z d dlZd dlmZmZ  G d de j                  Zedk    r e j                     dS dS )    N)parserprinterc                   0    e Zd Zdej        ddfdZddZdS )TestBasicFunctionsgraphreturnNc                 :   |                      t          |j                  d           |                      |j        d         j        d           |                      |j        d         j        d           |                      |j        d         j        d           d S )N   r   MatMul   Add   Softmax)assertEquallennodeop_type)selfr   s     R/var/www/html/ai-engine/env/lib/python3.11/site-packages/onnx/test/printer_test.pycheck_graphzTestBasicFunctions.check_graph   s    UZ!,,,A.999A.666A.	:::::    c                     d}t          j        |          }t          j        |          }t          j        |          }t          j        |          }|                     ||           |                     |           d S )Nz
           agraph (float[N, 128] X, float[128,10] W, float[10] B) => (float[N] C)
           {
              T = MatMul(X, W)
              S = Add(T, B)
              C = Softmax(S)
           }
           )r   parse_graphr   to_textr   r   )r   text0graph1text1graph2text2s         r   test_parse_graphz#TestBasicFunctions.test_parse_graph   s{     #E**''#E**'' 	&&&     r   )r   N)__name__
__module____qualname__onnx
GraphProtor   r     r   r   r   r   
   sL        ; ;T ; ; ; ;! ! ! ! ! !r   r   __main__)unittestr$   r   r   TestCaser   r!   mainr&   r   r   <module>r+      s                     ! ! ! ! !* ! ! !6 zHMOOOOO r   