Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb73a0cb

Browse files
committed
tiny changes
1 parent1d62c51 commitb73a0cb

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
7.76 KB
Binary file not shown.

‎_unittests/ut_graph_api/test_graph_builder.py‎renamed to ‎_unittests/ut_graph_api/test_graph_builder_optim.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importos
12
importunittest
23
importonnx
34
fromonnx_array_api.ext_test_caseimportExtTestCase
@@ -53,6 +54,26 @@ def test_keep_unused_outputs(self):
5354
self.assertEqual(len(onx.graph.node),2)
5455
self.assertEqual(onx.graph.node[0].op_type,"Split")
5556

57+
deftest_check_files(self):
58+
importonnxruntime
59+
60+
data=os.path.join(os.path.dirname(__file__),"data")
61+
filename= [fforfinos.listdir(data)iff.endswith(".onnx")]
62+
forfinfilename:
63+
withself.subTest(f=f):
64+
onx=onnx.load(os.path.join(data,f))
65+
sess=onnxruntime.InferenceSession(
66+
os.path.join(data,f),providers=["CPUExecutionProvider"]
67+
)
68+
assertsess
69+
g=GraphBuilder(onx)
70+
g.optimize()
71+
onx2=g.to_onnx()
72+
sess2=onnxruntime.InferenceSession(
73+
onx2.SerializeToString(),providers=["CPUExecutionProvider"]
74+
)
75+
assertsess2
76+
5677

5778
if__name__=="__main__":
5879
unittest.main(verbosity=2)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp