From f4162b7eafcb9c27292a9544b1a29f2fc7f54be6 Mon Sep 17 00:00:00 2001 From: Alexandre Passos Date: Thu, 17 May 2018 10:02:06 -0700 Subject: [PATCH] Allows the fizzbuzz example to work when called as fizzbuzz(tf.constant(10)). Fixes #18960 PiperOrigin-RevId: 197008373 --- tensorflow/docs_src/programmers_guide/eager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/docs_src/programmers_guide/eager.md b/tensorflow/docs_src/programmers_guide/eager.md index 9719858..970ec71 100644 --- a/tensorflow/docs_src/programmers_guide/eager.md +++ b/tensorflow/docs_src/programmers_guide/eager.md @@ -118,7 +118,7 @@ it is easy to write [fizzbuzz](https://en.wikipedia.org/wiki/Fizz_buzz): ```py def fizzbuzz(max_num): counter = tf.constant(0) - for num in range(max_num): + for num in range(max_num.numpy()): num = tf.constant(num) if int(num % 3) == 0 and int(num % 5) == 0: print('FizzBuzz') -- 2.7.4