Skip to content

Commit

Permalink
change based on #7462
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Yang committed Sep 10, 2024
1 parent bf125d8 commit 1fc5f8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graphbolt/src/fused_csc_sampling_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ inline int64_t UniformPick(
/** @brief An operator to perform non-uniform sampling. */
static torch::Tensor NonUniformPickOp(
torch::Tensor probs, int64_t fanout, bool replace) {
auto positive_probs_indices = probs.nonzero().squeeze(1);
auto positive_probs_indices = probs.contiguous().nonzero();
auto num_positive_probs = positive_probs_indices.size(0);
if (num_positive_probs == 0) return torch::empty({0}, torch::kLong);
if ((fanout == -1) || (num_positive_probs <= fanout && !replace)) {
Expand Down

0 comments on commit 1fc5f8a

Please sign in to comment.