A rank tensor can replace for loops, where the actual work is performed on the last dimensions.