Skip to content
Snippets Groups Projects
Commit 303e225d authored by auphelia's avatar auphelia
Browse files

[xnorpopcountmatmul] filled verify_node function

parent fd5f7f69
No related branches found
No related tags found
No related merge requests found
......@@ -57,3 +57,36 @@ class XnorPopcountMatMul(CustomOp):
output = xnorpopcountmatmul(inp0, inp1)
# set context according to output name
context[node.output[0]] = output
def verify_node(self):
info_messages = []
# verify number of attributes
num_of_attr = 0
if len(self.onnx_node.attribute) == num_of_attr:
info_messages.append("The number of attributes is correct")
else:
info_messages.append(
"""The number of attributes is incorrect,
{} should have {} attributes""".format(
self.onnx_node.op_type, num_of_attr
)
)
# verify that "domain" is set to "finn"
domain_value = self.onnx_node.domain
if domain_value == "finn":
info_messages.append("Attribute domain is set correctly")
else:
info_messages.append('Attribute domain should be set to "finn"')
# verify that all necessary attributes exist
info_messages.append("XnorPopcountMatMul should not have any attributes")
# verify the number of inputs
if len(self.onnx_node.input) == 2:
info_messages.append("The number of inputs is correct")
else:
info_messages.append("XnorPopcountMatMul needs 2 data inputs")
return info_messages
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