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

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