In some of the places, I saw the syntax, where variables are initialized with names, sometimes without names. For example:
# With name
var = tf.Variable(0, n
In fact, from the aspect to distinguish different variables, we totally can use the python name (the left part of the assignment sign, and we call the name as python name to avoid confusion. such as v in the following example) to name the variables. However, in the programming process, we usually rebind the python name to other objects (i.e., the op in Tensorflow), for example,
v = tf.get_variable("v1", [3], initializer = tf.zeros_initializer)
v = tf.get_variable("v2", [5], initializer = tf.zeros_initializer)
Firstly, the python name v bind the tensor form first line (tf.get_variable("v1", [3], initializer = tf.zeros_initializer)). Then,the v rebind the tensor from the second line (tf.get_variable("v2", [5], initializer = tf.zeros_initializer)) and didn't bind the first tensor anymore. If we didn't give the tensorflow attribute name v1 and v2, how can we identify the tensor from the first line?