Skip to content

Commit

Permalink
[NumPy] Fix uses of functions deprecated in NumPy 1.25.
Browse files Browse the repository at this point in the history
NumPy 1.25 deprecates a number of function aliases (https://github.com/numpy/numpy/releases/tag/v1.25.0rc1)

This change replaces uses of the deprecated names with their recommended replacements:
* `np.round_` -> `np.round`
* `np.product` -> `np.prod`
* `np.cumproduct` -> `np.cumprod`
* `np.sometrue` -> `np.any`
* `np.alltrue` -> `np.all`

The deprecated functions will issue a `DeprecationWarning` under NumPy 1.25, and will be removed in NumPy 2.0.

PiperOrigin-RevId: 539973324
Change-Id: I68df241a9e3a04997787cd3b47f08acccb02e19f
  • Loading branch information
hawkinsp authored and Copybara-Service committed Jun 13, 2023
1 parent 98c4204 commit 546a47a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions acme/wrappers/atari_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ def step(self, action: int) -> dm_env.TimeStep:
reward = sum(timestep_t.reward for timestep_t in timestep_stack)

# Multiply discount over stack (will either be 0. or 1.).
discount = np.product(
[timestep_t.discount for timestep_t in timestep_stack])
discount = np.prod([timestep_t.discount for timestep_t in timestep_stack])

observation = self._observation_from_timestep_stack(timestep_stack)

Expand Down

0 comments on commit 546a47a

Please sign in to comment.