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

Commitbf98384

Browse files
authored
Better comments (#84)
* better comments* status
1 parent53506d1 commitbf98384

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

‎_doc/examples/plot_benchmark_rf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
importnumpy
2323
importpandas
2424
fromlightgbmimportLGBMRegressor
25-
fromonnxmltools.convert.lightgbm.operator_converters.LightGbmimportconvert_lightgbm
26-
fromonnxmltools.convert.xgboost.operator_converters.XGBoostimportconvert_xgboost
2725
fromonnxruntimeimportInferenceSession,SessionOptions
2826
frompsutilimportcpu_count
2927
fromsphinx_runpython.runpythonimportrun_cmd
@@ -33,9 +31,14 @@
3331
fromsklearn.ensembleimportRandomForestRegressor
3432
fromtqdmimporttqdm
3533
fromxgboostimportXGBRegressor
34+
fromonnxmltools.convert.xgboost.operator_converters.XGBoostimportconvert_xgboost
3635

3736

3837
defskl2onnx_convert_lightgbm(scope,operator,container):
38+
fromonnxmltools.convert.lightgbm.operator_converters.LightGbmimport (
39+
convert_lightgbm,
40+
)
41+
3942
options=scope.get_options(operator.raw_operator)
4043
if"split"inoptions:
4144
operator.split=options["split"]

‎onnx_array_api/_command_lines_parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,14 @@ def _cmd_compare(argv: List[Any]):
123123

124124
parser=get_parser_compare()
125125
args=parser.parse_args(argv[1:])
126+
ifargs.verbosein ("1",1,"True",True):
127+
print(f"[compare] first model{args.model1!r}")
128+
print(f"[compare] second model{args.model2!r}")
126129
onx1=onnx.load(args.model1)
127130
onx2=onnx.load(args.model2)
131+
ifargs.verbosein ("1",1,"True",True):
132+
print(f"[compare] first model has{len(onx1.graph.node)} nodes")
133+
print(f"[compare] second model has{len(onx2.graph.node)} nodes")
128134
res1,res2,align,dc=compare_onnx_execution(
129135
onx1,
130136
onx2,

‎onnx_array_api/reference/evaluator_yield.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,15 +642,16 @@ def compare_onnx_execution(
642642
print("[compare_onnx_execution] loading first model")
643643
proto1=load(model1)ifisinstance(model1,str)elsemodel1
644644
ifverbose:
645-
print("[compare_onnx_execution] loadingfirst model")
645+
print("[compare_onnx_execution] loadingsecond model")
646646
proto2=load(model2)ifisinstance(model2,str)elsemodel2
647647
res1=list(_enumerate_result_no_execution(proto1))
648648
res2=list(_enumerate_result_no_execution(proto2))
649649
else:
650650
return
651651

652652
ifverbose:
653-
print(f"[compare_onnx_execution] got{len(res2)} results")
653+
print(f"[compare_onnx_execution] got{len(res1)} results (first model)")
654+
print(f"[compare_onnx_execution] got{len(res2)} results (second model)")
654655
print("[compare_onnx_execution] compute edit distance")
655656
dc=DistanceExecution()
656657
_,align=dc.distance_sequence(res1,res2)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp