Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JAX] Replace uses of jnp.array in types with jnp.ndarray. #4719

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

hvaara
Copy link
Contributor

@hvaara hvaara commented Aug 22, 2023

What does this PR do?

jnp.array is a function, not a type:
https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.array.html so it never makes sense to use jnp.array in a type annotation.

Presumably the intent was to write jnp.ndarray aka jax.Array. Change uses of jnp.array to jnp.ndarray.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

`jnp.array` is a function, not a type:
https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.array.html
so it never makes sense to use `jnp.array` in a type annotation.

Presumably the intent was to write `jnp.ndarray` aka `jax.Array`. Change uses of `jnp.array` to `jnp.ndarray`.

Co-authored-by: Peter Hawkins <phawkins@google.com>
@hvaara hvaara marked this pull request as ready for review August 22, 2023 17:29
@patrickvonplaten
Copy link
Contributor

Nice catch @hvaara - agree with you! cc @pcuenca can you check as well?

@hvaara
Copy link
Contributor Author

hvaara commented Oct 9, 2023

@pcuenca Does this LGTY?

@pcuenca
Copy link
Member

pcuenca commented Oct 9, 2023

@hvaara Yes, sorry! Running tests just in case.

@hvaara
Copy link
Contributor Author

hvaara commented Oct 9, 2023

No worries. Yes, please run the tests in case I've missed or broken something 😄 I have a very similar PR incoming to transformers soon (ie. minutes).

@pcuenca pcuenca merged commit 4ac205e into huggingface:main Oct 9, 2023
11 checks passed
@hvaara
Copy link
Contributor Author

hvaara commented Oct 9, 2023

Thanks for the reviews!

@hvaara hvaara deleted the jax-ndarray branch October 9, 2023 20:06
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
…ngface#4719)

`jnp.array` is a function, not a type:
https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.array.html
so it never makes sense to use `jnp.array` in a type annotation.

Presumably the intent was to write `jnp.ndarray` aka `jax.Array`. Change uses of `jnp.array` to `jnp.ndarray`.

Co-authored-by: Peter Hawkins <phawkins@google.com>
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
…ngface#4719)

`jnp.array` is a function, not a type:
https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.array.html
so it never makes sense to use `jnp.array` in a type annotation.

Presumably the intent was to write `jnp.ndarray` aka `jax.Array`. Change uses of `jnp.array` to `jnp.ndarray`.

Co-authored-by: Peter Hawkins <phawkins@google.com>
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.

3 participants