Created by: sneaxiy
Change the parameter of some methods in Tensor to be reference instead of copy to avoid deep copy.