Skip to content

Commit e5bb71c

Browse files
jvrecamaltanar
authored andcommitted
Addded del_initializer to modelwrapper.
1 parent 0fa5568 commit e5bb71c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/qonnx/core/modelwrapper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@ def get_initializer(self, tensor_name, return_dtype=False):
367367
else:
368368
return None
369369

370+
def del_initializer(self, initializer_name):
371+
"""Deletes an initializer from the model."""
372+
graph = self._model_proto.graph
373+
for init in graph.initializer:
374+
if init.name == initializer_name:
375+
graph.initializer.remove(init)
376+
break
377+
370378
def find_producer(self, tensor_name):
371379
"""Finds and returns the node that produces the tensor with given name."""
372380
for x in self._model_proto.graph.node:

0 commit comments

Comments
 (0)