"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "80c00e5451e0ced32043fbb0ed06eb6f3c427f82"
Unverified Commit 8c28f982 authored by Muhammed Fatih BALIN's avatar Muhammed Fatih BALIN Committed by GitHub
Browse files

[GraphBolt] Slight `gb.expand_indptr` improvement on CPU. (#7189)

parent 290dadb9
...@@ -23,7 +23,7 @@ torch::Tensor ExpandIndptr( ...@@ -23,7 +23,7 @@ torch::Tensor ExpandIndptr(
}); });
} }
if (!node_ids.has_value()) { if (!node_ids.has_value()) {
node_ids = torch::arange(indptr.size(0) - 1, indptr.options().dtype(dtype)); return torch::repeat_interleave(indptr.diff(), output_size).to(dtype);
} }
return node_ids.value().to(dtype).repeat_interleave( return node_ids.value().to(dtype).repeat_interleave(
indptr.diff(), 0, output_size); indptr.diff(), 0, output_size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment