Created
July 17, 2018 16:37
-
-
Save alexbw/db6da31d34542cf6810ad52d901f3469 to your computer and use it in GitHub Desktop.
Lists with AutoGraph
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
def f(n): | |
z = [] | |
# We ask you to tell us the element dtype of the list | |
autograph.set_element_type(z, tf.int32) | |
for i in range(n): | |
z.append(i) | |
# when you're done with the list, stack it | |
# (this is just like np.stack) | |
return autograph.stack(z) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment