Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Convert np.int -> np.int32 since np.int is deprecated #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bsuite/baselines/utils/sequence_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.)

Expand Down
2 changes: 1 addition & 1 deletion bsuite/environments/cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion bsuite/environments/catch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
2 changes: 1 addition & 1 deletion bsuite/experiments/cartpole_swingup/cartpole_swingup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down