Skip to content

Commit

Permalink
Added seed in array backend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-il-forte committed Dec 6, 2023
1 parent f56d3bc commit 42ab32d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/core/test_array_backend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy.random
import torch
import numpy as np
from mushroom_rl.core._impl import NumpyBackend, TorchBackend
Expand Down Expand Up @@ -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')
Expand All @@ -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)
Expand Down

0 comments on commit 42ab32d

Please sign in to comment.