Skip to content

Commit

Permalink
MAINT Use contiguous memoryviews in _random.pyx (scikit-learn#25871)
Browse files Browse the repository at this point in the history
  • Loading branch information
2357juan authored and Itay committed Apr 15, 2023
1 parent 794d7e9 commit e2b3b6d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sklearn/utils/_random.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ cpdef _sample_without_replacement_with_tracking_selection(
cdef cnp.int_t i
cdef cnp.int_t j
cdef cnp.int_t[:] out = np.empty((n_samples, ), dtype=int)
cdef cnp.int_t[::1] out = np.empty((n_samples, ), dtype=int)
rng = check_random_state(random_state)
rng_randint = rng.randint
Expand Down Expand Up @@ -133,9 +133,9 @@ cpdef _sample_without_replacement_with_pool(cnp.int_t n_population,
cdef cnp.int_t i
cdef cnp.int_t j
cdef cnp.int_t[:] out = np.empty((n_samples, ), dtype=int)
cdef cnp.int_t[::1] out = np.empty((n_samples, ), dtype=int)
cdef cnp.int_t[:] pool = np.empty((n_population, ),
cdef cnp.int_t[::1] pool = np.empty((n_population, ),
dtype=int)
rng = check_random_state(random_state)
Expand Down Expand Up @@ -195,7 +195,7 @@ cpdef _sample_without_replacement_with_reservoir_sampling(
cdef cnp.int_t i
cdef cnp.int_t j
cdef cnp.int_t[:] out = np.empty((n_samples, ), dtype=int)
cdef cnp.int_t[::1] out = np.empty((n_samples, ), dtype=int)
rng = check_random_state(random_state)
rng_randint = rng.randint
Expand Down

0 comments on commit e2b3b6d

Please sign in to comment.