Skip to content

Commit

Permalink
[Randomwalk] Fix off-by-one bug in GenericRandomWalk() (dmlc#3500)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickim555 authored Nov 15, 2021
1 parent 863c249 commit 2e8b56a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/sampling/randomwalks/randomwalks_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ std::pair<IdArray, IdArray> GenericRandomWalk(
CHECK_LT(curr, max_nodes) << "Seed node ID exceeds the maximum number of nodes.";

for (i = 0; i < max_num_steps; ++i) {
const auto &succ = step(traces_data + seed_id * max_num_steps, curr, i);
const auto &succ = step(traces_data + seed_id * trace_length, curr, i);
traces_data[seed_id * trace_length + i + 1] = curr = std::get<0>(succ);
eids_data[seed_id * max_num_steps + i] = std::get<1>(succ);
if (std::get<2>(succ))
Expand Down

0 comments on commit 2e8b56a

Please sign in to comment.