Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions backends/arm/test/tester/arm_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@ def run_method_and_compare_outputs(
for run_iteration in range(num_runs):
reference_input = inputs if inputs else next(self.generate_random_inputs())

# Avoid issues with inplace operators
test_input = copy.deepcopy(reference_input)
original_input = copy.deepcopy(reference_input)

input_shapes = [
generated_input.shape if hasattr(generated_input, "shape") else (1,)
for generated_input in reference_input
Expand All @@ -472,16 +476,16 @@ def run_method_and_compare_outputs(
# Run exported module directly
test_outputs, _ = pytree.tree_flatten(
self._calculate_reference_output(
exported_program.module(), reference_input
exported_program.module(), test_input
)
)
else:
# Run lowered model with target
test_outputs, _ = pytree.tree_flatten(
test_stage.run_artifact(reference_input)
test_stage.run_artifact(test_input)
)

logger.info(f"\n Input: {reference_input}")
logger.info(f"\n Input: {original_input}")
logger.info(f"\n Ref output: {reference_outputs}")
logger.info(f"\nTest output: {test_outputs}")

Expand Down
Loading