Skip to content

Commit e531c13

Browse files
committed
verbose
1 parent 97ac155 commit e531c13

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

_unittests/ut_light_api/test_backend_export.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import unittest
23
from typing import Any, Dict, List, Optional
34
from difflib import unified_diff
@@ -25,6 +26,8 @@
2526
from onnx_array_api.light_api import translate
2627
from onnx_array_api.plotting.text_plot import onnx_simple_text_plot
2728

29+
verbosity = 10 if "-v" in sys.argv or "--verbose" in sys.argv else 0
30+
2831

2932
class ReferenceImplementationError(RuntimeError):
3033
"Fails, export cannot be compared."
@@ -36,7 +39,7 @@ class ExportWrapper:
3639

3740
def __init__(self, model):
3841
self.model = model
39-
self.expected_sess = ExtendedReferenceEvaluator(self.model)
42+
self.expected_sess = ExtendedReferenceEvaluator(self.model, verbose=verbosity)
4043

4144
@property
4245
def input_names(self):
@@ -109,7 +112,7 @@ def run(
109112
f"Unable to executed code for api {api!r}\n{new_code}"
110113
) from e
111114
export_model = locs["model"]
112-
ref = ExtendedReferenceEvaluator(export_model)
115+
ref = ExtendedReferenceEvaluator(export_model, verbose=verbosity)
113116
try:
114117
got = ref.run(names, feeds)
115118
except (TypeError, AttributeError) as e:

onnx_array_api/light_api/make_helper.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,15 @@ def make_node_extended(
3434
"""
3535
Constructs a NodeProto.
3636
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
5046
"""
5147
node = NodeProto()
5248
node.op_type = op_type

0 commit comments

Comments
 (0)