You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why did the two prints inside the function show different output to the print from the return value of the function, in other words why was no value (numpy=array...) shown in the first two lines compared to the last two?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I was trying to understand how seed generation works (mainly with functions), my confusion is if I run this bit of code in my main program :
I get this output
tf.Tensor([0.2390374], shape=(1,), dtype=float32)
tf.Tensor([0.22267115], shape=(1,), dtype=float32)
two different tensors (obviously) but if I try to call it from a function :
I get this:
Tensor("random_uniform/RandomUniform:0", shape=(1,), dtype=float32)
Tensor("random_uniform_1/RandomUniform:0", shape=(1,), dtype=float32)
(<tf.Tensor: shape=(1,), dtype=float32, numpy=array([0.2390374], dtype=float32)>,
<tf.Tensor: shape=(1,), dtype=float32, numpy=array([0.2390374], dtype=float32)>)
There's two things I don't get:
a
andb
equal?Beta Was this translation helpful? Give feedback.
All reactions