Skip to content

Add runtime deprecation warnings to one_hot and multinomial#865

Open
t-suraj21 wants to merge 1 commit into
google-deepmind:mainfrom
t-suraj21:add-deprecation-warnings
Open

Add runtime deprecation warnings to one_hot and multinomial#865
t-suraj21 wants to merge 1 commit into
google-deepmind:mainfrom
t-suraj21:add-deprecation-warnings

Conversation

@t-suraj21

Copy link
Copy Markdown
  • Added DeprecationWarning to hk.one_hot() directing users to jax.nn.one_hot()
  • Added DeprecationWarning to hk.multinomial() directing users to jax.random.categorical()
  • Imported warnings module in haiku/_src/basic.py
  • These functions previously only had documentation warnings
  • All existing tests pass (31 tests in basic_test.py)

This helps users migrate away from deprecated APIs by providing runtime feedback rather than requiring them to read documentation.

- Added DeprecationWarning to hk.one_hot() directing users to jax.nn.one_hot()
- Added DeprecationWarning to hk.multinomial() directing users to jax.random.categorical()
- Imported warnings module in haiku/_src/basic.py
- These functions previously only had documentation warnings
- All existing tests pass (31 tests in basic_test.py)

This helps users migrate away from deprecated APIs by providing
runtime feedback rather than requiring them to read documentation.
@google-cla

google-cla Bot commented Jan 30, 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant