diff --git a/src/finn/core/modelwrapper.py b/src/finn/core/modelwrapper.py index 393061219d60e46b5cce5cc017d0f77f454ee7aa..6547c394711ff0bb23576d213de904c29943b4b8 100644 --- a/src/finn/core/modelwrapper.py +++ b/src/finn/core/modelwrapper.py @@ -33,6 +33,18 @@ class ModelWrapper: def graph(self, value): self._model_proto.graph = value + @property + def model(self): + return self._model_proto + + @model.setter + def model(self, value): + self._model_proto = value + + def save(self, filename): + """Save the wrapper ONNX ModelProto into a file with given name.""" + onnx.save(self._model_proto, filename) + def transform_repeated(self, transform): """Applies given transform repeatedly until no more changes can be made and returns a transformed ModelWrapper instance.