Skip to content

How do I print only the shape with jax.debug.print #17313

Answered by jakevdp
Logon27 asked this question in Q&A
Discussion options

You must be logged in to vote

jax.debug.print is designed for printing dynamic values. Array shapes are always static values, so the better tool would be a standard Python print:

# print dynamic array contents with debug print:
jax.debug.print("{}", results)

# print static array attributes with Python print:
print(results.shape)
print(results.dtype)

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
2 replies
@Logon27
Comment options

@ASEM000
Comment options

Comment options

You must be logged in to vote
10 replies
@jakevdp
Comment options

@ASEM000
Comment options

@Logon27
Comment options

@jakevdp
Comment options

@ASEM000
Comment options

Answer selected by Logon27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants