Skip to content

Navigation Menu

Sign in
Sign up

Fix meta_nets tracer compatibility under jax.jit - #4

Open
Maharishiva wants to merge 1 commit into
google-deepmind:main from
Maharishiva:fix/meta-nets-jax-tracer
Open

Fix meta_nets tracer compatibility under jax.jit #4
Maharishiva wants to merge 1 commit into
google-deepmind:main from
Maharishiva:fix/meta-nets-jax-tracer

Conversation

@Maharishiva

@Maharishiva Maharishiva commented Feb 7, 2026
edited
Loading

Copy link
Copy Markdown

Summary

This PR fixes a JAX tracer-compatibility issue in disco_rl/networks/meta_nets.py that can fail learner updates under jax.jit / lax.scan because of strict isinstance(..., chex.Array) checks.

Changes

  • Replace strict isinstance checks with tracer-safe array-like checks based on .shape.
  • Preserve type safety by raising TypeError for non-array-like values.
  • Add regression test disco_rl/networks/meta_nets_test.py that runs agent.learner_step under jax.jit.

Verification

  • PYTHONPATH=. python -m unittest disco_rl.networks.meta_nets_test -v passes with this patch.
  • The same test fails on baseline at meta_nets.py:93 (assert isinstance(logits, chex.Array)).

google-cla Bot commented Feb 7, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /