-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
2 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
from typing import Any, Iterable, Mapping, Union | ||
|
||
import jax | ||
import jax.numpy as jnp | ||
import numpy as np | ||
|
||
#: JAX or Numpy array | ||
Array = Union[np.ndarray, jnp.ndarray] | ||
|
||
#: JAX PyTrees | ||
PyTree = Union[Array, Iterable[Array], Mapping[Any, Array]] | ||
# It is not currently tested but we also support recursive PyTrees. | ||
# Once recursive typing is fully supported (https://github.com/python/mypy/issues/731), we can uncomment the line below. | ||
# PyTree = Union[Array, Iterable["PyTree"], Mapping[Any, "PyTree"]] | ||
PyTree = Union[Array, Iterable["PyTree"], Mapping[Any, "PyTree"]] | ||
|
||
#: JAX PRNGKey | ||
PRNGKey = jax.random.PRNGKeyArray |