chore: seed torch as much as possible

closes #877
This commit is contained in:
Benoit Chevallier-Mames
2021-11-23 17:54:29 +01:00
committed by Benoit Chevallier
parent 60d8079303
commit ec396effb2
3 changed files with 25 additions and 3 deletions

View File

@@ -80,12 +80,14 @@ N_BITS_ATOL_TUPLE_LIST = [
pytest.param(FC, (100, 32 * 32 * 3)),
],
)
def test_quantized_linear(model, input_shape, n_bits, atol):
def test_quantized_linear(model, input_shape, n_bits, atol, seed_torch):
"""Test the quantized module with a post-training static quantization.
With n_bits>>0 we expect the results of the quantized module
to be the same as the standard module.
"""
# Seed torch
seed_torch()
# Define the torch model
torch_fc_model = model()
# Create random input