@@ -35,23 +35,23 @@ sort_by_row(at::Tensor row, at::Tensor col, at::Tensor weight) {
3535}
3636
3737at::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
4343std::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
5151std::tuple<at::Tensor, at::Tensor, at::Tensor>
5252to_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