Statistical mechanics of low-rank tensor decomposition