In Tensorflow, what is the difference between a tensor that has a type ending in _ref and a tensor that does not?

The docs say:

In addition, variants of these types with the suffix _ref for reference tensors are defined.

What exactly does this mean? What are typical tensors and how do they differ from standard ones?

+5
source share
1 answer

Test tensor changed . The most common way to create a tensor with a typed type is to define tf.Variable : defining tf.Variable , whose initial value is dtype tf.float32 will create a tensor with a typed type with dtype tf.float32_ref . You can mutate the reference typed tensor by passing it as the first argument to tf.assign() .

(Note that reference tensors are implementation details in this version of TensorFlow. We recommend using higher-level wrappers, such as tf.Variable , which can be carried over to alternative representations for mutable state in the future.)

+6
source

All Articles