From 2dc8bddde8a12a97d75de9be6ae5aa66e5df7ea6 Mon Sep 17 00:00:00 2001 From: George Gekov Date: Thu, 2 Oct 2025 16:53:04 +0100 Subject: [PATCH] Arm backend: Change input distribution on resnet18 test Change-Id: I2fff51fa8afa0f350145fb5caf6abb38b7351c28 --- backends/arm/test/models/test_resnet18.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backends/arm/test/models/test_resnet18.py b/backends/arm/test/models/test_resnet18.py index 1c1011ec967..3cb21abd772 100644 --- a/backends/arm/test/models/test_resnet18.py +++ b/backends/arm/test/models/test_resnet18.py @@ -23,7 +23,8 @@ model = model.eval() normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) -model_inputs = (normalize(torch.randn((1, 3, 224, 224))),) +# Using torch.rand * 2 - 1 to generate numbers in the range [-1;1] like an RGB image +model_inputs = (normalize(torch.rand((1, 3, 224, 224)) * 2 - 1),) input_t = Tuple[torch.Tensor] @@ -71,7 +72,7 @@ def test_resnet_u55_INT(per_channel_quantization): exir_ops=[], use_to_edge_transform_and_lower=True, per_channel_quantization=per_channel_quantization, - atol=0.5, + atol=0.25, qtol=1, ) pipeline.run() @@ -91,7 +92,7 @@ def test_resnet_u85_INT(per_channel_quantization): exir_ops=[], use_to_edge_transform_and_lower=True, per_channel_quantization=per_channel_quantization, - atol=0.5, + atol=0.25, qtol=1, ) pipeline.run()