Created
May 10, 2021 08:07
-
-
Save kretes/ce4daa95e37d6d2d8d9e2d2eb0507a70 to your computer and use it in GitHub Desktop.
A short utility to apply over a tf.data.Dataset to display what is it processing at given stage
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
def print_ds(ds, what): | |
def print_elems(*args): | |
tf.print(f"len of {what}", len(args), *[tf.shape(a) for a in args], args[-1]) | |
return tuple(args) | |
return ds.map(print_elems) | |
ds = print_ds(ds, "1") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment