Skip to content

Commit

Permalink
remove squeeze(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Yang committed Sep 12, 2024
1 parent 1fc5f8a commit 6a02473
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graphbolt/src/fused_csc_sampling_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,8 @@ 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.contiguous().nonzero();
auto positive_probs_indices = probs.nonzero();
// returns a N-by-1 tensor, compatible with all data_ptr() usage below
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 6a02473

Please sign in to comment.