Added check NDim for same dtype.