TraceΒΆ
Returns the sum of the elements of the diagonal of the input 2-D matrix.
Abstract Signature:
Trace(input: Tensor)
PyTorch
API:
torch.traceStrategy: Macro 'torch.sum(torch.diagonal({a}, {offset}, {axis1}, {axis2}))'
Keras
API:
keras.ops.traceStrategy: Macro 'keras.ops.sum(keras.ops.diag({input}))'
Apple MLX
API:
mlx.core.traceStrategy: Macro 'mlx.core.sum(mlx.core.diagonal({input}))'