@@ -36,23 +36,23 @@ sort_by_row(at::Tensor row, at::Tensor col, at::Tensor weight) {
3636}
3737
3838at::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
4444std::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
5252std::tuple<at::Tensor, at::Tensor, at::Tensor>
5353to_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