Skip to content
Snippets Groups Projects
Commit 14d83b5b authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[CustomOp] raise exception if required attribute unspecified

parent d8ec2158
No related merge requests found
......@@ -56,8 +56,15 @@ class CustomOp(ABC):
ret = ret.decode("utf-8")
return ret
else:
# not set, return default value
return def_val
if req:
raise Exception(
"""Required attribute %s unspecified in
a %s node"""
% (name, self.onnx_node.op_type)
)
else:
# not set, return default value
return def_val
except KeyError:
raise AttributeError("Op has no such attribute: " + name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment