My understanding is that set seed is used to set the starting position of the the random generator. Therefore the first print is the first random uniform with a seed of 1234, while the second print is the second random uniform with a seed of 1234. For a new session, the seed will again be set to 1234.
Set seed is normally used to ensure that you get the same scenarios on different run and different hardware. Else it would be very hard and frustrating to error search code with errors dependent on random generators.
As an example we can start two different session and check that they are the same:
import tensorflow as tf
tf.compat.v1.random.set_random_seed(1234)
a = tf.random.uniform([1])
print('session 1')
with tf.compat.v1.Session() as sess1:
print(sess1.run(a)) # generates 'A1'
print(sess1.run(a)) # generates 'A1'
print('session 2')
with tf.compat.v1.Session() as sess1:
print(sess1.run(a)) # generates 'A1'
print(sess1.run(a)) # generates 'A1'
>> session 1
>> [0.96046877]
>> [0.8362156]
>> session 2
>> [0.96046877]
>> [0.8362156]
As predicted, both session gives the same output.
And you should get the same outputs if you try this on your computer.
This is an example of how to set seed between sessions. Instead setting random seed at the session level, do not seem to be possible to date?
For a more in depth discussion on this, see the comment for this question