
    bIg                        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                          yy)    )annotationsN)TensorProtohelpernumpy_helpershape_inferencec                      e Zd ZddZy)TestTrainingToolc                ~   ddg}d}t        j                  j                  | j                  t         j                        }t        j                  ||      }t        j                  |t        j                  |      }ddg}d}t        j                  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                  | 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#                  |       |j$                  j'                         }|j)                  |       t        j                  t+        |j,                  j.                        t+        |j$                  d   j0                  j.                        z   dt+        |j,                  j2                        t+        |j$                  d   j0                  j2                        z   t+        |j,                  j4                        t+        |j$                  d   j0                  j4                        z   t+        |j,                  j6                        t+        |j$                  d   j0                  j6                        z         }t        j                  |      }t9        j:                  |      }t        j                   j#                  |       y )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                                    Y/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/test/training_tool_test.pytest_training_info_protoz)TestTrainingTool.test_training_info_proto   s   a&IINNG$++BJJ7$//?44V[=N=NPWXa&IINNG$++BJJ7$//?44V[=N=NPWXa&44V[=N=NPWX))ff-x
 !++<(NM*
 a&IINNG$++BJJ7$//?44V[=N=NPWXa&44V[=N=NPWXF#H
  **F%~~

 11ff-.d

 !!/2  '!//335""=1 %//!!"T%*=*=a*@*J*J*O*O%PP!""#d5+>+>q+A+K+K+Q+Q&RR##$tE,?,?,B,L,L,S,S'TT(()5&&q)33??@A
 %//0CD*9*F*F+
' 	  !@A    N)returnNone)__name__
__module____qualname__rM    rN   rL   r	   r	      s	    RBrN   r	   __main__)
__future__r   unittestnumpyr   r$   r   r   r   r   TestCaser	   rQ   mainrT   rN   rL   <module>r[      sJ    #    C CSBx(( SBl zHMMO rN   