akshaymalviya
akshaymalviya

Reputation: 19

What is the difference in global_variables_initializer() and initialize_all_variables()?

In Tensorflow, what is the difference in global_variables_initializer() and initialize_all_variables()? I had used both methods to initialize the variables.

Upvotes: 1

Views: 207

Answers (2)

Eypros
Eypros

Reputation: 5723

I haven't check it out but according to this answer and my personal experience from code in previous versions of tensorflow initialize_all_variables() used to initialize both global and local variables when was not deprecated but in recent version (where it's considered deprecated) it's just a (deprecated) equivalent to global_variables_initializer().

So, depending on the version it might change the answer.

Upvotes: 0

javidcf
javidcf

Reputation: 59701

If you look at the docs, you will see that they do the same, but tf.initialize_all_variables is now deprecated in favour of tf.global_variables_initializer.

Upvotes: 1

Related Questions