Optimized Tensor contraction
Added different types of Tensor Contraction