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.

tensor an object to be checked.

bool, True if the given tensor is a DTensor.