Refactor to handle 3rd order tensors correctly.
Refactor to handle 3rd order tensors correctly.

thirdwing/mlpack,darcyliu/mlpack,ranjan1990/mlpack,erubboli/mlpack,erubboli/mlpack,ranjan1990/mlpack,ranjan1990/mlpack,palashahuja/mlpack,stereomatchingkiss/mlpack,darcyliu/mlpack,theranger/mlpack,lezorich/mlpack,ersanliqiao/mlpack,lezorich/mlpack,ajjl/mlpack,ajjl/mlpack,stereomatchingkiss/mlpack,thirdwing/mlpack,ajjl/mlpack,stereomatchingkiss/mlpack,BookChan/mlpack,theranger/mlpack,palashahuja/mlpack,palashahuja/mlpack,BookChan/mlpack,theranger/mlpack,lezorich/mlpack,BookChan/mlpack,thirdwing/mlpack,ersanliqiao/mlpack,darcyliu/mlpack,ersanliqiao/mlpack,erubboli/mlpack