Skip to content

Commit 0f6a1cc

Browse files
committed
pylint
1 parent 3a8bc96 commit 0f6a1cc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/backend_test_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import tensorflow as tf
2222
from tensorflow.python.ops import variables as variables_lib
2323
from common import get_test_config
24+
import onnx
2425
from tf2onnx import utils
2526
from tf2onnx.tfonnx import process_tf_graph
2627
from tf2onnx import optimizer
@@ -72,14 +73,12 @@ def run_onnxruntime(self, model_path, inputs, output_names):
7273
# opt.log_severity_level = 0
7374
# opt.log_verbosity_level = 255
7475
# opt.enable_profiling = True
75-
import onnx
7676
with open(model_path, 'rb') as f:
7777
onx = onnx.load(f)
7878
print(onx)
7979
try:
8080
m = rt.InferenceSession(model_path, opt)
8181
except Fail as e:
82-
import onnx
8382
with open(model_path, 'rb') as f:
8483
onx = onnx.load(f)
8584
raise AssertionError("Unable to load model '{}'\n{}".format(model_path, onx)) from e

tf2onnx/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from __future__ import print_function
1010
from __future__ import unicode_literals
1111

12+
import traceback
13+
import sys
1214
import collections
1315
import copy
1416
import logging
@@ -1305,8 +1307,6 @@ def replace_all_inputs(self, ops, old_input, new_input, debug=False, keep_ops=Fa
13051307
try:
13061308
assert False
13071309
except AssertionError:
1308-
import traceback
1309-
import sys
13101310
tb = traceback.extract_stack()
13111311
print()
13121312
for line in tb:

0 commit comments

Comments
 (0)