Variable
A TensorFlow variable is a mutable tensor-like object that stores state, such as model parameters, and can be updated or marked trainable for differentiation.
Deep Learning with R, Third Edition
A TensorFlow variable is a mutable tensor-like object that stores modifiable model state and can be updated by assignment.
- How it is used
- Stores mutable neural-network state and supplies values that training computations can update.
- How deep it goes
- Defines creation, full and indexed assignment, additive updates, and gradient tracking, but does not develop optimizer internals.
- Examples
- Uses zero- and one-filled matrices, indexed updates, additive updates, and a squared variable inside GradientTape.
- What you can do after
- Operate/configure it through tf$Variable, assign(), indexed assignment, assign_add(), and GradientTape.
Read how Deep Learning with R, Third Edition explains variable →
Deep Learning with Python, Third Edition
A mutable TensorFlow value that stores learnable parameters such as weights and bias in this example.
- How it is used
- Provides mutable state for TensorFlow models whose parameters change during gradient-based training.
- How deep it goes
- Defines mutability and demonstrates whole-value, subset, additive, and subtractive assignment before applying updates in a classifier.
- Examples
- Uses a random variable v and classifier parameters W and b, updated with assign, indexed assignment, assign_add, and assign_sub.
- What you can do after
- Apply it via TensorFlow to create mutable parameters and update them during a handwritten training loop.
Read how Deep Learning with Python, Third Edition explains variable →
Related concepts
- model parallelismused by · Model parallelism is a distributed-computing technique that partitions a machine-learning model’s parameters, layers, or computations across multiple devices.
- tensoruses · A tensor is a multidimensional, array-like structure of values indexed along zero or more dimensions and used for numerical computation.
- mathematical variableimplements · A mathematical variable is a symbol or quantity representing a value or attribute that can vary or be determined within a defined domain.
- variablekind of · A variable is a named program binding or entity associated with a value that can be accessed and, when permitted, changed during computation.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

