Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
removes non operator names
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed May 7, 2021
1 parent 4ac2469 commit 94af3be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mlprodict/onnxrt/ops_cpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def load_op(onnx_node, desc=None, options=None):
"Operator '{}' has no runtime yet. Available list:\n"
"{}\n--- +\n{}".format(
name, "\n".join(sorted(_additional_ops)),
"\n".join(sorted(d_op_list))))
"\n".join(
_ for _ in sorted(d_op_list)
if "_" not in _ and _ not in {'cl', 'clo', 'name'})))

if hasattr(cl, 'version_higher_than'):
opv = min(current_opset, chosen_opset)
Expand All @@ -104,7 +106,9 @@ def load_op(onnx_node, desc=None, options=None):
"'{}'\n--ONNX--\n{}\n--AVAILABLE--\n{}".format(
cl.version_higher_than, opv, opset,
options['target_opset'], cl.__name__, onnx_node,
"\n".join(sorted(d_op_list))))
"\n".join(
_ for _ in sorted(d_op_list)
if "_" not in _ and _ not in {'cl', 'clo', 'name'})))
options = options.copy()
options['target_opset'] = current_opset
return load_op(onnx_node, desc=desc, options=options)
Expand Down
4 changes: 4 additions & 0 deletions mlprodict/onnxrt/ops_cpu/_op_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@
_op_list = []
clo = locals().copy()
for name, cl in clo.items():
if "_" in name:
continue
if name in {'cl', 'clo', 'name'}:
continue
if not cl.__doc__ and issubclass(cl, OpRun):
cl.__doc__ = get_rst_doc(cl.__name__)
_op_list.append(cl)

0 comments on commit 94af3be

Please sign in to comment.