cor() and cov() for a 2D data matrix is easy to write.
However, TBH, it is not that straight-forward e.g. for a OHE-encoded tensor built from that 2D data matrix.
So, what about nice-written cor() and cov() for a tensor?