why random gives different result with global and operation level seed pre-set #361
chenalb0075
started this conversation in
General
Replies: 1 comment
-
Hi, If you check the documentation (https://www.tensorflow.org/api_docs/python/tf/random/set_seed) of tf.random.set_seed, you will see that the second print method uses a different operation seed. If you want to get the same tensor, you need to assign the tf.random.set_seed again with the same value "1234" as below tf.random.set_seed(1234) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i am just started to learn tensorflow. From the document i know that when global and operation level seed were set, i supposed to generate the same tensor value. But when i run following code on colab, it always gave different value.
code:
import tensorflow as tf
tf.random.set_seed=1234
print(tf.random.normal([2,2],seed=18))
print(tf.random.normal([2,2],seed=18))
Can somebody tell me what's wrong here?
Beta Was this translation helpful? Give feedback.
All reactions