From f2190bae3a2cf93f6e92bac495479126383964cc Mon Sep 17 00:00:00 2001 From: jnke2016 Date: Fri, 20 Sep 2024 18:32:31 -0700 Subject: [PATCH] clean up code --- cpp/src/sampling/neighbor_sampling_impl.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/src/sampling/neighbor_sampling_impl.hpp b/cpp/src/sampling/neighbor_sampling_impl.hpp index 65be8da0b46..cd62bbd06c5 100644 --- a/cpp/src/sampling/neighbor_sampling_impl.hpp +++ b/cpp/src/sampling/neighbor_sampling_impl.hpp @@ -73,7 +73,7 @@ neighbor_sample_impl(raft::handle_t const& handle, static_assert(std::is_floating_point_v); std::vector, bool>> edge_masks_vector{}; - std::optional> modified_graph_view{std::nullopt}; + graph_view_t modified_graph_view = graph_view; CUGRAPH_EXPECTS(fan_out.size() > 0, "Invalid input argument: number of levels must be non-zero."); @@ -87,13 +87,13 @@ neighbor_sample_impl(raft::handle_t const& handle, cugraph::edge_property_t, bool> edge_mask(handle, graph_view); - cugraph::fill_edge_property(handle, graph_view, edge_mask.mutable_view(), bool{true}); + cugraph::fill_edge_property(handle, modified_graph_view, edge_mask.mutable_view(), bool{true}); - (*modified_graph_view).attach_edge_mask(edge_mask.view()); + modified_graph_view.attach_edge_mask(edge_mask.view()); cugraph::transform_e( handle, - *modified_graph_view, + modified_graph_view, cugraph::edge_src_dummy_property_t{}.view(), cugraph::edge_dst_dummy_property_t{}.view(), *edge_type_view, @@ -172,7 +172,7 @@ neighbor_sample_impl(raft::handle_t const& handle, std::vector level_sizes{}; - auto cur_graph_view = modified_graph_view ? *modified_graph_view : graph_view; + auto cur_graph_view = modified_graph_view; // Get the number of hop. If homogeneous neighbor sample, num_edge_types = 1