Created
February 28, 2023 16:38
-
-
Save rahulremanan/9f6267755b04182541067900c9719876 to your computer and use it in GitHub Desktop.
Performance optimization through a decorated Tensorflow function
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
@tf.function | |
def run_named_tuple_graph(): | |
_ijk0 = (tf.constant(0), Pair(tf.constant(1), tf.constant(2))) | |
_ijk_fin = tf.while_loop(c, b, _ijk0) | |
return _ijk_fin | |
ijk_final = run_named_tuple_graph() | |
print(ijk_final[-1].j.numpy(), ijk_final[-1].k.numpy()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment