Clarified docstring and removed unnecessary subtensor.
Tests for subtensor_of_dot, and corrected optimization for tensors with more than 2 dimensions.