Added ndim check to subtensor.

Minor change
checkNDim must be before get_xview, as get_xview use x.