Skip to content

Commit

Permalink
fix: fix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
askorupka committed Oct 11, 2024
1 parent 7db4adc commit 7211d9d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions GNNGraphs/src/sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ function sample_neighbors(g::GNNGraph{<:COO_T}, nodes, K = -1;
return gnew
end


"""
induced_subgraph(graph::GNNGraph, nodes::Vector{Int})
induced_subgraph(graph, nodes)
Generates a subgraph from the original graph using the provided `nodes`.
The function includes the nodes' neighbors and creates edges between nodes that are connected in the original graph.
Expand All @@ -127,12 +128,12 @@ Returns A new `GNNGraph` containing the subgraph with the specified nodes and th
# Arguments
- `graph::GNNGraph`. The original graph containing nodes, edges, and node features.
- `nodes::Vector{Int}. A vector of node indices to include in the subgraph.
- `graph`. The original GNNGraph containing nodes, edges, and node features.
- `nodes``. A vector of node indices to include in the subgraph.
# Examples
```jldoctest
```julia
julia> s = [1, 2]
2-element Vector{Int64}:
1
Expand Down Expand Up @@ -167,6 +168,7 @@ GNNGraph:
x = 32×2 Matrix{Float32}
edata:
e = 1-element Vector{Float32}
```
"""
function Graphs.induced_subgraph(graph::GNNGraph, nodes::Vector{Int})
if isempty(nodes)
Expand Down

0 comments on commit 7211d9d

Please sign in to comment.