Watch talks from the 2019 TensorFlow Dev Summit Watch now

tff.utils.assign

tff.utils.assign(
    target,
    source
)

Defined in core/utils/tf_computation_utils.py.

Creates an op that assigns target from source.

This utility function provides the exact same behavior as tf.assign, but it generalizes to a wider class of objects, including ordinary variables as well as various types of nested structures.

Args:

  • target: A nested structure composed of variables embedded in containers that are compatible with tf.contrib.framework.nest, or instances of anonymous_tuple.AnonymousTuple.
  • source: A nsested structure composed of tensors, matching that of target.

Returns:

A single op that represents the assignment.

Raises:

  • TypeError: If types mismatch.