Implement the basic tensor classes