W3cubDocs

/TensorFlow 2.9

tf.experimental.dtensor.copy_to_mesh

Copies a tf.Tensor onto the DTensor device with the given layout.

Copies a regular tf.Tensor onto the DTensor device. Use the mesh attached to layout as target mesh. This method currently only supports replicated layouts. To get a DTensor with a sharded layout, use the pack method.

Args
tensor A regular tf.Tensor to be copied as a DTensor.
layout Target layout (and mesh) for the result DTensor.
source_layout Source layout of the tensor before copy, used for backward passes.
Returns
A DTensor on the DTensor device with the given layout.

© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/experimental/dtensor/copy_to_mesh