Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/qonnx/custom_op/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,17 @@ def get_nodeattr(self, name):
ret = ret.decode("utf-8")
elif dtype == "strings":
ret = [x.decode("utf-8") for x in ret]
elif dtype == "t":
# use numpy helper to convert TensorProto -> np array
ret = np_helper.to_array(ret)
elif dtype == "floats":
# convert from RepeatedScalarContainer to list
# gives e.g. JSON serializability
ret = [x for x in ret]
elif dtype == "ints":
# convert from RepeatedScalarContainer to list
# gives e.g. JSON serializability
ret = [x for x in ret]
elif dtype == "t":
# use numpy helper to convert TensorProto -> np array
ret = np_helper.to_array(ret)
if allowed_values is not None:
assert ret in allowed_values, "%s = %s not in %s" % (
str(name),
Expand Down
Loading