1. Home
  2. Data Science
  3. TensorFlow
  4. What is the key difference between tf.Variable and…

Added 2 Nov 2026

What is the key difference between tf.Variable and tf.constant?

  1. They are identical names for the same object type
  2. A constant is stored on the GPU; a Variable cannot be
  3. A Variable's value can be updated; a constant's cannot Correct answer
  4. A Variable holds only scalars; a constant holds arrays

Correct answer

C. A Variable's value can be updated; a constant's cannot

16 views

MCQSEXAM

Explanation

Model weights are tf.Variable objects so optimisers can assign new values during training. Tensors created with tf.constant are immutable.

Reference

Asked in: Data Science Interviews, AI Engineer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More TensorFlow MCQs

Practise all TensorFlow MCQs

Similar MCQs