From: Alexandre Passos Date: Thu, 17 May 2018 17:02:06 +0000 (-0700) Subject: Allows the fizzbuzz example to work when called as fizzbuzz(tf.constant(10)). X-Git-Tag: upstream/v1.9.0_rc1~94^2^2~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4162b7eafcb9c27292a9544b1a29f2fc7f54be6;p=platform%2Fupstream%2Ftensorflow.git Allows the fizzbuzz example to work when called as fizzbuzz(tf.constant(10)). Fixes #18960 PiperOrigin-RevId: 197008373 --- 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')