Fix an error where range of permuted tensor indices in the permuting tensor constructors.
Tensor::scale_to now uses the correct  element-wise operation.