Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions csrc/cpu/neighbor_sample_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ hetero_sample(const vector<node_t> &node_types,
} else {
// Sample without replacement:
unordered_set<int64_t> rnd_indices;
for (int64_t j = col_count - num_samples; j < col_count; j++) {
for (int64_t j = col_count - num_samples + 1; j < col_count + 1; j++) {
int64_t rnd = uniform_randint(j);
if (!rnd_indices.insert(rnd).second) {
rnd = j;
rnd_indices.insert(j);
rnd = j - 1;
rnd_indices.insert(rnd);
}
const int64_t offset = col_start + rnd;
const int64_t &v = row_data[offset];
Expand Down
Loading