<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.15.1/tensorflow/dtensor/python/api.py#L131-L144) |

Returns the singleton DTensor device's name.

```python
tf.experimental.dtensor.device_name() -> str
```

This function can be used in the following way:

```python
import tensorflow as tf

with tf.device(dtensor.device_name()):
  # ...
```