<br />

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

TensorFlow variant of NumPy's `trace`.

    tf.experimental.numpy.trace(
        a, offset=0, axis1=0, axis2=1, dtype=None
    )

Unsupported arguments: `out`.

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