new optimized tensor impl