Skip to content

Commit 8ac6300

Browse files
authored
Arm backend: Change input distribution on resnet18 test (#14815)
cc @freddan80 @per @zingo @oscarandersson8218 @digantdesai
1 parent 4ac04c5 commit 8ac6300

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backends/arm/test/models/test_resnet18.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
model = model.eval()
2424
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
2525

26-
model_inputs = (normalize(torch.randn((1, 3, 224, 224))),)
26+
# Using torch.rand * 2 - 1 to generate numbers in the range [-1;1] like an RGB image
27+
model_inputs = (normalize(torch.rand((1, 3, 224, 224)) * 2 - 1),)
2728

2829
input_t = Tuple[torch.Tensor]
2930

@@ -71,7 +72,7 @@ def test_resnet_u55_INT(per_channel_quantization):
7172
exir_ops=[],
7273
use_to_edge_transform_and_lower=True,
7374
per_channel_quantization=per_channel_quantization,
74-
atol=0.5,
75+
atol=0.25,
7576
qtol=1,
7677
)
7778
pipeline.run()
@@ -91,7 +92,7 @@ def test_resnet_u85_INT(per_channel_quantization):
9192
exir_ops=[],
9293
use_to_edge_transform_and_lower=True,
9394
per_channel_quantization=per_channel_quantization,
94-
atol=0.5,
95+
atol=0.25,
9596
qtol=1,
9697
)
9798
pipeline.run()

0 commit comments

Comments
 (0)