Skip to content

Commit cdef7d8

Browse files
author
Yaman Umuroglu
authored
Merge pull request #188 from fastmachinelearning/feature/switch-to-graph-metadata
Store Metadata in Graph Proto rather than model Proto
2 parents 7bb3a27 + 9264cac commit cdef7d8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/qonnx/core/modelwrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,20 +566,20 @@ def get_tensor_fanout(self, tensor_name):
566566
def get_metadata_prop(self, key):
567567
"""Returns the value associated with metadata_prop with given key,
568568
or None otherwise."""
569-
metadata_prop = util.get_by_name(self.model.metadata_props, key, "key")
569+
metadata_prop = util.get_by_name(self.model.graph.metadata_props, key, "key")
570570
if metadata_prop is None:
571571
return None
572572
else:
573573
return metadata_prop.value
574574

575575
def set_metadata_prop(self, key, value):
576576
"""Sets metadata property with given key to the given value."""
577-
metadata_prop = util.get_by_name(self.model.metadata_props, key, "key")
577+
metadata_prop = util.get_by_name(self.model.graph.metadata_props, key, "key")
578578
if metadata_prop is None:
579579
metadata_prop = onnx.StringStringEntryProto()
580580
metadata_prop.key = key
581581
metadata_prop.value = value
582-
self.model.metadata_props.append(metadata_prop)
582+
self.model.graph.metadata_props.append(metadata_prop)
583583
else:
584584
metadata_prop.value = value
585585

0 commit comments

Comments
 (0)