
    Si                        S SK Jr  S SKrS SKJrJr   " S S\R                  5      r\S:X  a  \R                  " 5         gg)    )annotationsN)inlinerparserc                  ,    \ rS rSrS rS rS rS rSrg)InlinerTest   c                :   [         R                  " S5      n[        R                  " U5      nUR                  R
                  nU R                  [        U5      S5        U R                  US   R                  S5        U R                  US   R                  S5        g )Na  
            <ir_version: 8, opset_import: [ "" : 17, "local" : 1 ]>
            agraph (float[N] X) => (float[N] Y)
            {
                Y = local.foo (X)
            }

            <opset_import: [ "" : 17, "local" : 1 ], domain: "local">
            foo (x) => (y) {
                temp = Add(x, x)
                y = local.bar(temp)
            }

            <opset_import: [ "" : 17 ], domain: "local">
            bar (x) => (y) {
                y = Mul (x, x)
            }
           r   Add   Mul)	r   parse_modelr   inline_local_functionsgraphnodeassertEquallenop_type)selfmodelinlinedinlined_nodess       U/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/onnx/test/inliner_test.py
test_basicInlinerTest.test_basic   s    ""
( 007**]+Q/q)1159q)1159    c                    [         R                  " S5      n[        R                  " US/SS9nUR                  R
                  nU R                  [        U5      S5        U R                  US   R                  S5        U R                  US   R                  S	5        UR                  S   R
                  nU R                  [        U5      S5        U R                  US   R                  S
5        U R                  US   R                  S5        g )NA  
            <ir_version: 8, opset_import: [ "" : 17, "local" : 1 ]>
            agraph (float[N] X) => (float[N] Y)
            {
                T = local.square (X)
                Y = local.double_and_square (T)
            }

            <opset_import: [ "" : 17, "local" : 1 ], domain: "local">
            double_and_square (x) => (y) {
                double = Add(x, x)
                y = local.square(double)
            }

            <opset_import: [ "" : 17 ], domain: "local">
            square (x) => (y) {
                y = Mul (x, x)
            }
        )localsquareFexcluder
   r   r   r   double_and_squarer   
r   r   r   inline_selected_functionsr   r   r   r   r   	functionsr   r   r   r   function_nodess        r   test_selective_inlining#InlinerTest.test_selective_inlining(   s    ""
* 33'(%
  **]+Q/q)1159q)113FG !**1-22^,a0*22E:*22E:r   c                    [         R                  " S5      n[        R                  " US/SS9nUR                  R
                  nU R                  [        U5      S5        U R                  US   R                  S5        U R                  US   R                  S	5        UR                  S   R
                  nU R                  [        U5      S5        U R                  US   R                  S
5        U R                  US   R                  S5        g )Nr   )r   r#   Tr!   r
   r   r   r   r#   r   r$   r'   s        r   test_selective_exclusion$InlinerTest.test_selective_exclusionM   s    ""
* 3323T
  **]+Q/q)1159q)113FG !**1-22^,a0*22E:*22E:r   c                    [         R                  " S5      n[        R                  " U/ SSS9nUR                  R
                  nU R                  SU Vs/ s H  oDR                  PM     sn5        g s  snf )Nz
            <ir_version: 8, opset_import: [ "" : 20]>
            agraph (float[N] X) => (float[N] Y)
            {
                Y = Softsign (X)
            }
        T)r"   inline_schema_functionsAbs)r   r   r   r%   r   r   assertInr   )r   r   r   r   ns        r   test_schema_function_inlining)InlinerTest.test_schema_function_inliningr   se    ""
 332tT
  **e?Aii?@?s   A1
 N)	__name__
__module____qualname____firstlineno__r   r)   r,   r3   __static_attributes__r5   r   r   r   r      s    :8#;J#;JAr   r   __main__)

__future__r   unittestonnxr   r   TestCaser   r6   mainr5   r   r   <module>rA      s?    #   uA(## uAp zMMO r   