File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change
1
+ import sys
1
2
import unittest
2
3
from typing import Any , Dict , List , Optional
3
4
from difflib import unified_diff
25
26
from onnx_array_api .light_api import translate
26
27
from onnx_array_api .plotting .text_plot import onnx_simple_text_plot
27
28
29
+ verbosity = 10 if "-v" in sys .argv or "--verbose" in sys .argv else 0
30
+
28
31
29
32
class ReferenceImplementationError (RuntimeError ):
30
33
"Fails, export cannot be compared."
@@ -36,7 +39,7 @@ class ExportWrapper:
36
39
37
40
def __init__ (self , model ):
38
41
self .model = model
39
- self .expected_sess = ExtendedReferenceEvaluator (self .model )
42
+ self .expected_sess = ExtendedReferenceEvaluator (self .model , verbose = verbosity )
40
43
41
44
@property
42
45
def input_names (self ):
@@ -109,7 +112,7 @@ def run(
109
112
f"Unable to executed code for api { api !r} \n { new_code } "
110
113
) from e
111
114
export_model = locs ["model" ]
112
- ref = ExtendedReferenceEvaluator (export_model )
115
+ ref = ExtendedReferenceEvaluator (export_model , verbose = verbosity )
113
116
try :
114
117
got = ref .run (names , feeds )
115
118
except (TypeError , AttributeError ) as e :
Original file line number Diff line number Diff line change @@ -34,19 +34,15 @@ def make_node_extended(
34
34
"""
35
35
Constructs a NodeProto.
36
36
37
- Args:
38
- op_type: The name of the operator to construct
39
- inputs: list of input names
40
- outputs: list of output names
41
- name: optional unique identifier for NodeProto
42
- doc_string: optional documentation string for NodeProto
43
- domain: optional domain for NodeProto.
44
- If it's None, we will just use default domain (which is empty)
45
- **kwargs (dict): the attributes of the node. The acceptable values
46
- are documented in :func:`make_attribute`.
47
-
48
- Returns:
49
- NodeProto
37
+ :param op_type: The name of the operator to construct
38
+ :param inputs: list of input names
39
+ :param outputs: list of output names
40
+ :param name: optional unique identifier for NodeProto
41
+ :param doc_string: optional documentation string for NodeProto
42
+ :param domain: optional domain for NodeProto.
43
+ If it's None, we will just use default domain (which is empty)
44
+ :param kwargs: the attributes of the node.
45
+ :return: node proto
50
46
"""
51
47
node = NodeProto ()
52
48
node .op_type = op_type
You can’t perform that action at this time.
0 commit comments