From f8d81b2f1c27ef2c8c71ae286001ed879ea306ab Mon Sep 17 00:00:00 2001 From: jjshoots Date: Mon, 6 Mar 2023 15:50:00 +0000 Subject: [PATCH] convert np.int -> np.int32 --- bsuite/baselines/utils/sequence_test.py | 2 +- bsuite/environments/cartpole.py | 2 +- bsuite/environments/catch.py | 2 +- bsuite/experiments/cartpole_swingup/cartpole_swingup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bsuite/baselines/utils/sequence_test.py b/bsuite/baselines/utils/sequence_test.py index 985a487b..fca9e0a6 100644 --- a/bsuite/baselines/utils/sequence_test.py +++ b/bsuite/baselines/utils/sequence_test.py @@ -32,7 +32,7 @@ def test_buffer(self): obs_shape = (3, 3) buffer = sequence.Buffer( obs_spec=specs.Array(obs_shape, dtype=np.float), - action_spec=specs.Array((), dtype=np.int), + action_spec=specs.Array((), dtype=np.int32), max_sequence_length=max_sequence_length) dummy_step = dm_env.transition(observation=np.zeros(obs_shape), reward=0.) diff --git a/bsuite/environments/cartpole.py b/bsuite/environments/cartpole.py index ea6133db..41cdd382 100644 --- a/bsuite/environments/cartpole.py +++ b/bsuite/environments/cartpole.py @@ -159,7 +159,7 @@ def _reset(self) -> dm_env.TimeStep: raise NotImplementedError('This environment implements its own auto-reset.') def action_spec(self): - return specs.DiscreteArray(dtype=np.int, num_values=3, name='action') + return specs.DiscreteArray(dtype=np.int32, num_values=3, name='action') def observation_spec(self): return specs.Array(shape=(1, 6), dtype=np.float32, name='state') diff --git a/bsuite/environments/catch.py b/bsuite/environments/catch.py index 5f88f4f0..a396d8f0 100644 --- a/bsuite/environments/catch.py +++ b/bsuite/environments/catch.py @@ -104,7 +104,7 @@ def observation_spec(self) -> specs.BoundedArray: def action_spec(self) -> specs.DiscreteArray: """Returns the action spec.""" return specs.DiscreteArray( - dtype=np.int, num_values=len(_ACTIONS), name="action") + dtype=np.int32, num_values=len(_ACTIONS), name="action") def _observation(self) -> np.ndarray: self._board.fill(0.) diff --git a/bsuite/experiments/cartpole_swingup/cartpole_swingup.py b/bsuite/experiments/cartpole_swingup/cartpole_swingup.py index 13c3b9e9..ea417af6 100644 --- a/bsuite/experiments/cartpole_swingup/cartpole_swingup.py +++ b/bsuite/experiments/cartpole_swingup/cartpole_swingup.py @@ -129,7 +129,7 @@ def _reset(self) -> dm_env.TimeStep: raise NotImplementedError('This environment implements its own auto-reset.') def action_spec(self): - return specs.DiscreteArray(dtype=np.int, num_values=3, name='action') + return specs.DiscreteArray(dtype=np.int32, num_values=3, name='action') def observation_spec(self): return specs.Array(shape=(1, 8), dtype=np.float32, name='state')