Reorganized tensor operation code into scaling/summation/contraction dirs