
    wi                        d dl mZ d dlZd dlZd dlZd dlmZmZmZm	Z	  G d dej
                  Zedk    r ej                     dS dS )    )annotationsN)TensorProtohelpernumpy_helpershape_inferencec                      e Zd ZddZdS )TestTrainingToolreturnNonec                   ddg}d}t          j        j        |                     t           j                  }t          j        ||          }t          j        |t          j
        |          }ddg}d}t          j        j        |                     t           j                  }t          j        ||          }	t          j        |t          j
        |          }
ddg}d}t          j        |t          j
        |          }t          j        d||g|g          }t          j        |gd||
g|g||	g          }ddg}d	}t          j        j        |                     t           j                  }t          j        ||          }t          j        |t          j
        |          }ddg}d
}t          j        |t          j
        |          }t          j        d||g|g          }t          j        |gd|g|g|g          }t          j        |||fgd d           }t          j        |          }t          j                            |           |j                                        }|                    |           t          j        t+          |j        j                  t+          |j        d         j        j                  z   dt+          |j        j                  t+          |j        d         j        j                  z   t+          |j        j                  t+          |j        d         j        j                  z   t+          |j        j                  t+          |j        d         j        j                  z             }t          j        |          }t9          j        |          }t          j                            |           d S )N   A)nameBCMatMul)inputsoutputssimple_inferenceXYsimple_trainingr   full_training_graph)nprandomrandastypefloat32r   
from_arrayr   make_tensor_value_infor   FLOAT	make_node
make_graphmake_training_info
make_modelonnxcheckercheck_modeltraining_infoaddCopyFromlistgraphnode	algorithminputoutputinitializerr   infer_shapes) selfA_shapeA_namer   A_initializerA_value_infoB_shapeB_namer   B_initializerB_value_infoC_shapeC_nameC_value_infoinference_nodeinference_graphX_shapeX_namer   X_initializerX_value_infoY_shapeY_nameY_value_infor.   training_graphr)   modelnew_training_infor   full_training_modelfull_training_model_with_shapess                                    l/root/.openclaw/workspace/chatterbox_venv_py311/lib/python3.11/site-packages/onnx/test/training_tool_test.pytest_training_info_protoz)TestTrainingTool.test_training_info_proto   s   a&ING$++BJ77$/???4V[=NPWXXa&ING$++BJ77$/???4V[=NPWXXa&4V[=NPWXX)ff-x
 
 
 !+<(NM*
 
 a&ING$++BJ77$/???4V[=NPWXXa&4V[=NPWXXF#H
 
 
  *F%~~
 

 1ff-.d
 

 !/22  '''!/3355""=111 %/!""T%*=a*@*J*O%P%PP!"##d5+>q+A+K+Q&R&RR#$$tE,?,B,L,S'T'TT())5&q)3?@@A
 
 %/0CDD*9*F+
 +
' 	  !@AAAAA    N)r
   r   )__name__
__module____qualname__rO    rP   rN   r	   r	      s4        RB RB RB RB RB RBrP   r	   __main__)
__future__r   unittestnumpyr   r&   r   r   r   r   TestCaser	   rQ   mainrT   rP   rN   <module>r[      s    # " " " " "       C C C C C C C C C C C CSB SB SB SB SBx( SB SB SBl zHMOOOOO rP   