Skip to content

Commit 4f04f0c

Browse files
authored
fix duration assertion and index bug (#1123)
1 parent c5d9106 commit 4f04f0c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

neural_compressor/adaptor/ox_utils/onnxrt_mid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def augment_graph(self, activation_only=False, weight_only=False):
132132
tensors_to_dump.update(node.input)
133133
tensors_to_dump.update(node.output)
134134
if node.op_type == 'EmbedLayerNormalization' and len(node.output) > 1 and \
135-
node.output[2] in tensors_to_dump:
136-
tensors_to_dump.remove(node.output[2])
135+
node.output[1] in tensors_to_dump:
136+
tensors_to_dump.remove(node.output[1])
137137
elif weight_only:
138138
for input in node.input:
139139
if self.already_quantized and \

neural_compressor/objective.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def start(self):
134134
self.start_time = time.time()
135135
def end(self):
136136
self.duration = time.time() - self.start_time
137-
assert self.duration > 0, 'please use start() before end()'
137+
assert self.duration >= 0, 'please use start() before end()'
138138
self._result_list.append(self.duration)
139139

140140
@objective_registry

0 commit comments

Comments
 (0)