With tensorflow version >3.2 you may use this command:
x1 = tf.Variable(5)
y1 = tf.Variable(3)
z1 = x1 + y1
init = tf.compat.v1.global_variables_initializer()
with tf.compat.v1.Session() as sess:
init.run()
print(sess.run(z1))
The output: 8 will be displayed.