What is the difference between Variables and Placeholders?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Feb 22, 2018

 

The major differences between Variables and Placeholders are

S. No.CriteriaVariablesPlaceholders
1.Based on UsageVariables are used to store the present as well as the past state of a graph.Placeholders are used to feed external data into a graph and the data is assigned to a later date.
2.Based on declaration commandTo declare a variable we use the tf.Variable() command.To declare a placeholder tf.placeholder() command.
3.Based on the requirement of initializationThe variables are needed to be initialized before running the graph.Initialization is not required in the case of the placeholders.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    TensorFlow Interview Questions

    What is TensorFlow? Please Explain

    TensorFlow is a platform where one can learn machine learning / deep learning/multilayer neural networks from the Google library. Libraries that use data science are helpful to describe complex networ...

    TensorFlow Interview Questions

    Enlist few major features of the TensorFlow.

    Below are major features of TensorFlow:TensorFlow has the biggest ability is to build neural networks using which machines can develop logical thinking and learning analogous to humans. It is one...

    TensorFlow Interview Questions

    What are the tensors ? How many types of tensors are available?

    Tensors can be thought of as vectors and matrices of higher dimensions. They represent n-dimensional arrays of base data-type. Each element of a tensor is of the same data-type which is always known. ...