Navigation Menu

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

Commit

Permalink
Avoids raising an exception when an optional parameter is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jul 26, 2021
1 parent 6ea9551 commit d2f45bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mlprodict/onnxrt/ops_cpu/_op.py
Expand Up @@ -116,7 +116,7 @@ def __init__(self, onnx_node, desc=None, expected_attributes=None,

if onnx_node.op_type not in _at_least_one:
for k, v in self._schema.attributes.items():
if not hasattr(self, k):
if not hasattr(self, k) and getattr(v, 'required', True):
raise RuntimeError( # pragma: no cover
"Attribute '{}' is expected based on ONNX specifications "
"for node '{}' and options {}.".format(
Expand Down

0 comments on commit d2f45bb

Please sign in to comment.