From 42ab32d10c3abcbc7d84dd7c1da174af0d78134a Mon Sep 17 00:00:00 2001 From: boris-il-forte Date: Wed, 6 Dec 2023 14:31:38 +0100 Subject: [PATCH] Added seed in array backend tests --- tests/core/test_array_backend.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/core/test_array_backend.py b/tests/core/test_array_backend.py index e94481cc..ec6663d2 100644 --- a/tests/core/test_array_backend.py +++ b/tests/core/test_array_backend.py @@ -1,3 +1,4 @@ +import numpy.random import torch import numpy as np from mushroom_rl.core._impl import NumpyBackend, TorchBackend @@ -33,6 +34,8 @@ def sequence_generator(): def test_pack_sequance_numpy(): + numpy.random.seed(42) + for array, lengths in sequence_generator(): print('################################## Numpy') print('original') @@ -53,6 +56,8 @@ def test_pack_sequance_numpy(): def test_pack_sequance_torch(): + numpy.random.seed(42) + for array, lengths in sequence_generator(): torch_array = torch.as_tensor(array) torch_lengths = torch.as_tensor(lengths)