tensor.trace

Syntax

f = tensor.trace(t)

Get the trace of a tensor. The tensor trace is the sum of the diagonal elements.

Returns:

f - tensor trace

Arguments:

t - tensor