Approximate Rank-Detecting Factorization of Low-Rank Tensors