
    wi                        d dl m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 )    )annotationsN)parserprinterc                      e Zd ZddZd	dZdS )
TestBasicFunctionsgraphonnx.GraphProtoreturnNonec                :   |                      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     f/root/.openclaw/workspace/chatterbox_venv_py311/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   N)r   r	   r
   r   )r
   r   )__name__
__module____qualname__r   r#    r   r   r   r      s<        ; ; ; ;! ! ! ! ! !r   r   __main__)

__future__r   unittestonnxr   r   TestCaser   r$   mainr'   r   r   <module>r.      s    # " " " " "                  ! ! ! ! !* ! ! !6 zHMOOOOO r   