# tf.experimental.numpy.diag_indices

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/ops/numpy_ops/np_array_ops.py#L1187-L1197) |

TensorFlow variant of NumPy's `diag_indices`.

    tf.experimental.numpy.diag_indices(
        n, ndim=2
    )

See the NumPy documentation for [`numpy.diag_indices`](https://numpy.org/doc/1.16/reference/generated/numpy.diag_indices.html).