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

Better typing #469

Open
manuelgloeckler opened this issue Oct 24, 2024 · 0 comments
Open

Better typing #469

manuelgloeckler opened this issue Oct 24, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@manuelgloeckler
Copy link
Contributor

manuelgloeckler commented Oct 24, 2024

Currently, we do not follow jax typing practices. Official suggestion are given here, which more or less suggest the following rules

import jax.numpy as jnp
from jax import Array
from jax.typing import ArrayLike
# Type inputs as ArrayLike (floats, np.array, jnp.array...)
# Type output as Array
def f(x: ArrayLike) -> Array:
     return jnp.pow(x,2)

Currently we often use jnp.ndarray which is an alias for Array.

@michaeldeistler michaeldeistler added the good first issue Good for newcomers label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants