Skip to content

Commit

Permalink
Added a check for raw_data field (#3685)
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Peswani <[email protected]>
Co-authored-by: Harsh Peswani <[email protected]>
  • Loading branch information
quic-alanmaha and quic-hpeswani authored Dec 20, 2024
1 parent e3fba94 commit c6bd0bb
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,19 @@ def __init__(self,

raw_data = dict()
for initializer in self.model.model.graph.initializer:
raw_data[initializer.name] = initializer.raw_data
initializer.ClearField("raw_data")
if initializer.HasField('raw_data'):
raw_data[initializer.name] = initializer.raw_data
initializer.ClearField("raw_data")

self._float_extractor = Extractor(self.model.model)

for initializer in self.model.model.graph.initializer:
initializer.raw_data = raw_data[initializer.name]
if initializer.name in raw_data:
initializer.raw_data = raw_data[initializer.name]

for initializer in self._float_extractor.model.graph.initializer:
initializer.raw_data = raw_data[initializer.name]
if initializer.name in raw_data:
initializer.raw_data = raw_data[initializer.name]

self._sim_extractor = copy.deepcopy(self._float_extractor)

Expand Down

0 comments on commit c6bd0bb

Please sign in to comment.