W3cubDocs

/TensorFlow

tf.experimental.dtensor.is_dtensor

Check whether the input tensor is a DTensor.

In Python, a DTensor has the same type as a tf.Tensor. This method will let you check and handle the tensor differently if a tf.Tensor is a DTensor.

Args
tensor an object to be checked.
Returns
bool, True if the given tensor is a DTensor.

© 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/api_docs/python/tf/experimental/dtensor/is_dtensor