Skip to content

Commit eae34d5

Browse files
committed
prepend at::
1 parent 6667f3d commit eae34d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cuda/utils.cuh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ sort_by_row(at::Tensor row, at::Tensor col, at::Tensor weight) {
3636
}
3737

3838
at::Tensor degree(at::Tensor row, int64_t num_nodes) {
39-
auto zero = zeros(num_nodes, row.options());
40-
auto one = ones(row.size(0), row.options());
39+
auto zero = at::zeros(num_nodes, row.options());
40+
auto one = at::ones(row.size(0), row.options());
4141
return zero.scatter_add_(0, row, one);
4242
}
4343

4444
std::tuple<at::Tensor, at::Tensor> to_csr(at::Tensor row, at::Tensor col,
4545
int64_t num_nodes) {
4646
std::tie(row, col) = sort_by_row(row, col);
4747
row = degree(row, num_nodes).cumsum(0);
48-
row = at::cat({zeros(1, row.options()), row}, 0); // Prepend zero.
48+
row = at::cat({at::zeros(1, row.options()), row}, 0); // Prepend zero.
4949
return std::make_tuple(row, col);
5050
}
5151

5252
std::tuple<at::Tensor, at::Tensor, at::Tensor>
5353
to_csr(at::Tensor row, at::Tensor col, at::Tensor weight, int64_t num_nodes) {
5454
std::tie(row, col, weight) = sort_by_row(row, col, weight);
5555
row = degree(row, num_nodes).cumsum(0);
56-
row = at::cat({zeros(1, row.options()), row}, 0); // Prepend zero.
56+
row = at::cat({at::zeros(1, row.options()), row}, 0); // Prepend zero.
5757
return std::make_tuple(row, col, weight);
5858
}

0 commit comments

Comments
 (0)