Tensor computations with dimensionality manipulations