Added ndim check to subtensor.

Changed check dim place.
Merge pull request #1940 from Hengjean/CheckNDimSubtensor

Added ndim check to subtensor.