Skip to content

Accept NumPy integers for rollout sizing - #3511

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/rollout-numpy-integer-sizes
Open

Accept NumPy integers for rollout sizing#3511
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/rollout-numpy-integer-sizes

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Summary

Allow rollout to accept NumPy integer scalar values for nstep and chunk_size.

These values commonly come from NumPy computations. np.int64(3) is a valid integral value but is not an instance of Python's built-in int, so current validation rejects it before the rollout reaches the native implementation.

This change:

  • accepts np.integer alongside Python int for nstep
  • accepts np.integer alongside Python int for chunk_size
  • adds focused regression coverage for both arguments
  • keeps all existing dimension and value checks unchanged

This revives the still-relevant fix from closed, unmerged PR #3300 against current main.

Validation

The final branch is based directly on current main and contains one focused commit changing only python/mujoco/rollout.py plus a regression test.

The MuJoCo Python extension was not built in this execution environment, so the new runtime regression test was not executed locally and no local test pass is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant