Last active
March 27, 2019 18:59
-
-
Save Blaizzy/a878d12f5bd6039aef0177d9e551b30c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @tf.function | |
| def f(x): | |
| for i in range(10): # Static python loop, we'll not convert it | |
| do_stuff() | |
| for i in tf.range(10): # depends on a tensor, we'll convert it | |
| # function call | |
| f(10) | |
| # If you're curious you can inspect the code autograph generates. | |
| # PS: Read the code at your own risk !!! | |
| print(tf.autograph.to_code(f)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment