Skip to content

Commit 6667f3d

Browse files
committed
added namespace
1 parent eb20916 commit 6667f3d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpu/utils.h

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

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

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

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

0 commit comments

Comments
 (0)