Add jnp.get_printoptions and jnp.printoptions.

`jnp.set_printoptions` already exists but other printing utilities do not.

`jnp.get_printoptions` forwards `numpy.get_printoptions`.
`jnp.printoptions` forwards `numpy.printoptions`.
This commit is contained in:
Dan Zheng 2021-09-09 15:55:27 -07:00
parent 4d68a79921
commit 035b27ffb2
3 changed files with 8 additions and 1 deletions

View File

@ -177,6 +177,7 @@ Not every function in NumPy is implemented; contributions are welcome!
full
full_like
gcd
get_printoptions
geomspace
gradient
greater
@ -301,6 +302,7 @@ Not every function in NumPy is implemented; contributions are welcome!
polyval
positive
power
printoptions
prod
product
promote_types

View File

@ -89,7 +89,10 @@ PZERO = np.PZERO
NZERO = np.NZERO
nan = np.nan
# And some numpy utility functions
# NumPy utility functions
get_printoptions = np.get_printoptions
printoptions = np.printoptions
set_printoptions = np.set_printoptions
# We want isinstance(x, np.ndarray) checks in user code to work with the our

View File

@ -161,6 +161,7 @@ from jax._src.numpy.lax_numpy import (
full_like as full_like,
gcd as gcd,
geomspace as geomspace,
get_printoptions as get_printoptions,
gradient as gradient,
greater as greater,
greater_equal as greater_equal,
@ -289,6 +290,7 @@ from jax._src.numpy.lax_numpy import (
polyval as polyval,
positive as positive,
power as power,
printoptions as printoptions,
prod as prod,
product as product,
promote_types as promote_types,