Fix the fizzbuzz example
authorAlexandre Passos <apassos@google.com>
Thu, 17 May 2018 18:17:58 +0000 (11:17 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 17 May 2018 18:20:53 +0000 (11:20 -0700)
PiperOrigin-RevId: 197021930

tensorflow/docs_src/programmers_guide/eager.md

index 970ec71..00d02b4 100644 (file)
@@ -118,6 +118,7 @@ it is easy to write [fizzbuzz](https://en.wikipedia.org/wiki/Fizz_buzz):
 ```py
 def fizzbuzz(max_num):
   counter = tf.constant(0)
+  max_num = tf.convert_to_tensor(max_num)
   for num in range(max_num.numpy()):
     num = tf.constant(num)
     if int(num % 3) == 0 and int(num % 5) == 0: