Skip to content

Commit 350e59f

Browse files
authored
Merge branch 'JuliaGraphs:master' into fix/unbatch-zero-edge-graphs
2 parents 399bbb4 + 5bcf181 commit 350e59f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

GNNGraphs/src/sampling.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function sample_nbrs(loader::NeighborLoader, node::Int, layer::Int)
5858
return Int[]
5959
else
6060
num_samples = min(loader.num_neighbors[layer], length(neighbors)) # Limit to required samples for this layer
61-
return rand(neighbors, num_samples) # Randomly sample neighbors
61+
return StatsBase.sample(neighbors, num_samples; replace = false) # Randomly sample distinct neighbors
6262
end
6363
end
6464

0 commit comments

Comments
 (0)