Added ndim check to subtensor.

Changed check dim place.