...

/

TF Constants and Variables

TF Constants and Variables

Learn about TF constants and variables and their uses.

We'll cover the following...

In TF2, tensors can be of two types: constant or variable. However, TF1 supports placeholders for its default graph execution mode. Here, we explain some properties of both constants and variables.

TF constants

We can create immutable tensors with tf.constant(), where tf is an alias for TensorFlow. To generate a constant tensor, we can write tf.constant(15). If ...