Skip to main content
Ctrl+K
NVIDIA cuGraph - Home NVIDIA cuGraph - Home

NVIDIA cuGraph

  • Basics
  • nx-cugraph
  • Installation
  • Tutorials
  • Graph Support
    • WholeGraph
    • References
    • Developer Resources
    • API Reference
  • GitHub
Home
cugraph
cucimcudf-javacudfcugraphcumlcuvsdask-cudadask-cudfkvikiolibcudflibcumllibkvikiolibrapidsmpflibucxxnvforestraftrapids-cmakerapidsmpfrmmucxx
nightly (26.08)
nightly (26.08)stable (26.06)legacy (26.04)
NVIDIA cuGraph - Home NVIDIA cuGraph - Home

NVIDIA cuGraph

  • Basics
  • nx-cugraph
  • Installation
  • Tutorials
  • Graph Support
  • WholeGraph
  • References
  • Developer Resources
  • API Reference
  • GitHub

Section Navigation

Core Graph API Documentation

  • cugraph API Reference
    • Graph Classes
      • cugraph.Graph
      • cugraph.MultiGraph
      • cugraph.Graph.from_cudf_adjlist
      • cugraph.Graph.from_cudf_edgelist
      • cugraph.Graph.from_dask_cudf_edgelist
      • cugraph.Graph.from_pandas_adjacency
      • cugraph.Graph.from_pandas_edgelist
      • cugraph.Graph.from_numpy_array
      • cugraph.Graph.from_numpy_matrix
      • cugraph.Graph.add_internal_vertex_id
      • cugraph.Graph.add_nodes_from
      • cugraph.Graph.clear
      • cugraph.Graph.unrenumber
      • cugraph.symmetrize
      • cugraph.symmetrize_ddf
      • cugraph.symmetrize_df
      • cugraph.from_adjlist
      • cugraph.from_cudf_edgelist
      • cugraph.from_edgelist
      • cugraph.from_numpy_array
      • cugraph.from_numpy_matrix
      • cugraph.from_pandas_adjacency
      • cugraph.from_pandas_edgelist
      • cugraph.to_numpy_array
      • cugraph.to_numpy_matrix
      • cugraph.to_pandas_adjacency
      • cugraph.to_pandas_edgelist
      • cugraph.structure.NumberMap
      • cugraph.structure.NumberMap.from_internal_vertex_id
      • cugraph.structure.NumberMap.to_internal_vertex_id
      • cugraph.structure.NumberMap.add_internal_vertex_id
      • cugraph.structure.NumberMap.compute_vals
      • cugraph.structure.NumberMap.compute_vals_types
      • cugraph.structure.NumberMap.generate_unused_column_name
      • cugraph.structure.NumberMap.renumber
      • cugraph.structure.NumberMap.renumber_and_segment
      • cugraph.structure.NumberMap.set_renumbered_col_names
      • cugraph.structure.NumberMap.unrenumber
      • cugraph.structure.NumberMap.vertex_column_size
      • cugraph.hypergraph
    • Graph Implementation
      • cugraph.structure.graph_implementation.simpleGraphImpl.view_edge_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.delete_edge_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.view_adj_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.view_transposed_adj_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.delete_adj_list
      • cugraph.structure.graph_implementation.simpleGraphImpl.enable_batch
      • cugraph.structure.graph_implementation.simpleGraphImpl.get_two_hop_neighbors
      • cugraph.structure.graph_implementation.simpleGraphImpl.number_of_vertices
      • cugraph.structure.graph_implementation.simpleGraphImpl.number_of_nodes
      • cugraph.structure.graph_implementation.simpleGraphImpl.number_of_edges
      • cugraph.structure.graph_implementation.simpleGraphImpl.in_degree
      • cugraph.structure.graph_implementation.simpleGraphImpl.out_degree
      • cugraph.structure.graph_implementation.simpleGraphImpl.degree
      • cugraph.structure.graph_implementation.simpleGraphImpl.degrees
      • cugraph.structure.graph_implementation.simpleGraphImpl.has_edge
      • cugraph.structure.graph_implementation.simpleGraphImpl.has_node
      • cugraph.structure.graph_implementation.simpleGraphImpl.has_self_loop
      • cugraph.structure.graph_implementation.simpleGraphImpl.edges
      • cugraph.structure.graph_implementation.simpleGraphImpl.nodes
      • cugraph.structure.graph_implementation.simpleGraphImpl.neighbors
      • cugraph.structure.graph_implementation.simpleGraphImpl.vertex_column_size
    • Centrality
      • cugraph.centrality.betweenness_centrality
      • cugraph.centrality.edge_betweenness_centrality
      • cugraph.dask.centrality.betweenness_centrality.betweenness_centrality
      • cugraph.dask.centrality.betweenness_centrality.edge_betweenness_centrality
      • cugraph.centrality.katz_centrality
      • cugraph.dask.centrality.katz_centrality.katz_centrality
      • cugraph.centrality.degree_centrality
      • cugraph.centrality.eigenvector_centrality
      • cugraph.dask.centrality.eigenvector_centrality.eigenvector_centrality
    • Community
      • cugraph.ego_graph
      • cugraph.dask.community.egonet
      • cugraph.ecg
      • cugraph.dask.community.ecg.ecg
      • cugraph.k_truss
      • cugraph.ktruss_subgraph
      • cugraph.dask.community.ktruss_subgraph.ktruss_subgraph
      • cugraph.leiden
      • cugraph.dask.community.leiden.leiden
      • cugraph.dask.community.leiden.leiden
      • cugraph.louvain
      • cugraph.dask.community.louvain.louvain
      • cugraph.analyzeClustering_edge_cut
      • cugraph.analyzeClustering_modularity
      • cugraph.analyzeClustering_ratio_cut
      • cugraph.spectralBalancedCutClustering
      • cugraph.spectralModularityMaximizationClustering
      • cugraph.induced_subgraph
      • cugraph.dask.community.induced_subgraph.induced_subgraph
      • cugraph.triangle_count
      • cugraph.dask.community.triangle_count.triangle_count
    • Components
      • cugraph.connected_components
      • cugraph.strongly_connected_components
      • cugraph.weakly_connected_components
      • cugraph.dask.components.connectivity.weakly_connected_components
    • Cores
      • cugraph.core_number
      • cugraph.dask.cores.core_number.core_number
      • cugraph.k_core
      • cugraph.dask.cores.k_core.k_core
    • Layout
      • cugraph.force_atlas2
    • Linear Assignment
      • cugraph.hungarian
      • cugraph.dense_hungarian
    • Link Analysis
      • cugraph.hits
      • cugraph.dask.link_analysis.hits.hits
      • cugraph.pagerank
      • cugraph.dask.link_analysis.pagerank.pagerank
    • Link Prediction
      • cugraph.cosine
      • cugraph.link_prediction.cosine
      • cugraph.jaccard
      • cugraph.jaccard_coefficient
      • cugraph.overlap
      • cugraph.overlap_coefficient
      • cugraph.dask.link_prediction.overlap.overlap
      • cugraph.sorensen
      • cugraph.sorensen_coefficient
      • cugraph.dask.link_prediction.sorensen.sorensen
    • Sampling
      • cugraph.biased_random_walks
      • cugraph.heterogeneous_neighbor_sample
      • cugraph.homogeneous_neighbor_sample
      • cugraph.dask.sampling.biased_random_walks.biased_random_walks
      • cugraph.dask.sampling.random_walks.random_walks
      • cugraph.dask.sampling.uniform_random_walks.uniform_random_walks
      • cugraph.sampling.node2vec_random_walks
      • cugraph.dask.sampling.node2vec_random_walks.node2vec_random_walks
    • Traversal
      • cugraph.bfs
      • cugraph.bfs_edges
      • cugraph.dask.traversal.bfs.bfs
      • cugraph.filter_unreachable
      • cugraph.shortest_path
      • cugraph.shortest_path_length
      • cugraph.sssp
      • cugraph.dask.traversal.sssp.sssp
    • Tree
      • cugraph.tree.minimum_spanning_tree.minimum_spanning_tree
      • cugraph.tree.minimum_spanning_tree.maximum_spanning_tree
    • Generators
      • cugraph.generators.rmat
    • DASK MG Helper functions
      • cugraph.dask.comms.comms.initialize
      • cugraph.dask.comms.comms.destroy
      • cugraph.dask.comms.comms.is_initialized
      • cugraph.dask.comms.comms.get_comms
      • cugraph.dask.comms.comms.get_workers
      • cugraph.dask.comms.comms.get_session_id
      • cugraph.dask.comms.comms.get_2D_partition
      • cugraph.dask.comms.comms.get_default_handle
      • cugraph.dask.comms.comms.get_handle
      • cugraph.dask.comms.comms.get_worker_id
      • cugraph.dask.common.read_utils.get_chunksize
    • Multi-GPU with cuGraph
  • pylibcugraph API reference
    • pylibcugraph.eigenvector_centrality
    • pylibcugraph.katz_centrality
    • pylibcugraph.strongly_connected_components
    • pylibcugraph.weakly_connected_components
    • pylibcugraph.pagerank
    • pylibcugraph.hits
    • pylibcugraph.bfs
    • pylibcugraph.sssp
  • cuGraph C API documentation
    • Centrality
    • Community
    • Core
    • Components
    • Sampling
    • Similarity
    • Traversal
  • cuGraph C++ API
    • Algorithmns
      • Centrality
      • Community
      • Sampling
      • Similarity
      • Traversal
      • Linear
      • Link Analysis
      • Layout
      • Tree
      • Utility Functions
    • Graph Functions
    • Graph Generators
    • Legacy Graph Functions
    • Sampling Functions
    • Collection Wrappers
    • Low Level cuGraph C++ API

Graph Neural Networks API Documentation

  • cugraph-pyg API Reference
    • cugraph_pyg.data.graph_store.GraphStore
    • cugraph_pyg.data.feature_store.FeatureStore
    • cugraph_pyg.loader.node_loader.NodeLoader
    • cugraph_pyg.loader.neighbor_loader.NeighborLoader
    • cugraph_pyg.loader.link_loader.LinkLoader
    • cugraph_pyg.loader.link_neighbor_loader.LinkNeighborLoader
    • cugraph_pyg.sampler.sampler.BaseSampler
    • cugraph_pyg.sampler.sampler.SampleReader
    • cugraph_pyg.sampler.sampler.HomogeneousSampleReader
    • cugraph_pyg.sampler.sampler.HeterogeneousSampleReader
    • cugraph_pyg.sampler.sampler.SampleIterator
    • cugraph_pyg.sampler.distributed_sampler.BaseDistributedSampler
    • cugraph_pyg.sampler.distributed_sampler.DistributedNeighborSampler
  • API Reference
  • cugraph-pyg API Reference
  • cugraph_pyg.loader.link_neighbor_loader.LinkNeighborLoader

cugraph_pyg.loader.link_neighbor_loader.LinkNeighborLoader#

class cugraph_pyg.loader.link_neighbor_loader.LinkNeighborLoader(
data: torch_geometric.data.Data | torch_geometric.data.HeteroData | Tuple[torch_geometric.data.FeatureStore, torch_geometric.data.GraphStore],
num_neighbors: List[int] | Dict[torch_geometric.typing.EdgeType, List[int]],
edge_label_index: torch_geometric.typing.InputEdges = None,
edge_label: torch_geometric.typing.OptTensor = None,
edge_label_time: torch_geometric.typing.OptTensor = None,
replace: bool = False,
subgraph_type: torch_geometric.typing.SubgraphType | str = 'directional',
disjoint: bool = False,
temporal_strategy: str = 'uniform',
neg_sampling: torch_geometric.sampler.NegativeSampling | None = None,
neg_sampling_ratio: int | float | None = None,
time_attr: str | None = None,
weight_attr: str | None = None,
transform: Callable | None = None,
transform_sampler_output: Callable | None = None,
is_sorted: bool = False,
filter_per_worker: bool | None = None,
neighbor_sampler: torch_geometric.sampler.NeighborSampler | None = None,
directed: bool = True,
batch_size: int = 16,
compression: str | None = None,
local_seeds_per_call: int | None = None,
temporal_comparison: str | None = None,
**kwargs,
)[source]#

Duck-typed version of torch_geometric.loader.LinkNeighborLoader

Link loader that implements the neighbor sampling algorithm used in GraphSAGE.

__init__(
data: torch_geometric.data.Data | torch_geometric.data.HeteroData | Tuple[torch_geometric.data.FeatureStore, torch_geometric.data.GraphStore],
num_neighbors: List[int] | Dict[torch_geometric.typing.EdgeType, List[int]],
edge_label_index: torch_geometric.typing.InputEdges = None,
edge_label: torch_geometric.typing.OptTensor = None,
edge_label_time: torch_geometric.typing.OptTensor = None,
replace: bool = False,
subgraph_type: torch_geometric.typing.SubgraphType | str = 'directional',
disjoint: bool = False,
temporal_strategy: str = 'uniform',
neg_sampling: torch_geometric.sampler.NegativeSampling | None = None,
neg_sampling_ratio: int | float | None = None,
time_attr: str | None = None,
weight_attr: str | None = None,
transform: Callable | None = None,
transform_sampler_output: Callable | None = None,
is_sorted: bool = False,
filter_per_worker: bool | None = None,
neighbor_sampler: torch_geometric.sampler.NeighborSampler | None = None,
directed: bool = True,
batch_size: int = 16,
compression: str | None = None,
local_seeds_per_call: int | None = None,
temporal_comparison: str | None = None,
**kwargs,
)[source]#
data: Data, HeteroData, or Tuple[FeatureStore, GraphStore]

See torch_geometric.loader.LinkNeighborLoader.

num_neighbors: List[int] or Dict[EdgeType, List[int]]

Fanout values. See torch_geometric.loader.LinkNeighborLoader.

edge_label_index: InputEdges

Input edges for sampling. See torch_geometric.loader.LinkNeighborLoader.

edge_label: OptTensor

Labels for input edges. See torch_geometric.loader.LinkNeighborLoader.

edge_label_time: OptTensor

Time attribute for input edges. See torch_geometric.loader.LinkNeighborLoader.

replace: bool (optional, default=False)

Whether to sample with replacement. See torch_geometric.loader.LinkNeighborLoader.

subgraph_type: Union[SubgraphType, str] (optional, default=’directional’)

The type of subgraph to return. Currently only ‘directional’ is supported. See torch_geometric.loader.LinkNeighborLoader.

disjoint: bool (optional, default=False)

Whether to perform disjoint sampling. See torch_geometric.loader.LinkNeighborLoader.

temporal_strategy: str (optional, default=’uniform’)

Currently only ‘uniform’ is suppported. See torch_geometric.loader.LinkNeighborLoader.

time_attr: str (optional, default=None)

Used for temporal sampling. See torch_geometric.loader.LinkNeighborLoader.

weight_attr: str (optional, default=None)

Used for biased sampling. See torch_geometric.loader.LinkNeighborLoader.

transform: Callable (optional, default=None)

See torch_geometric.loader.LinkNeighborLoader.

transform_sampler_output: Callable (optional, default=None)

See torch_geometric.loader.LinkNeighborLoader.

is_sorted: bool (optional, default=False)

Ignored by cuGraph. See torch_geometric.loader.LinkNeighborLoader.

filter_per_worker: bool (optional, default=False)

Currently ignored by cuGraph, but this may change once in-memory sampling is implemented. See torch_geometric.loader.LinkNeighborLoader.

neighbor_sampler: torch_geometric.sampler.NeighborSampler

(optional, default=None) Not supported by cuGraph. See torch_geometric.loader.LinkNeighborLoader.

directed: bool (optional, default=True)

Deprecated. See torch_geometric.loader.LinkNeighborLoader.

batch_size: int (optional, default=16)

The number of input nodes per output minibatch. See torch.utils.dataloader.

compression: str (optional, default=None)

The compression type to use if writing samples to disk. If not provided, it is automatically chosen.

local_seeds_per_call: int (optional, default=None)

The number of seeds to process within a single sampling call. Manually tuning this parameter is not recommended but reducing it may conserve GPU memory. The total number of seeds processed per sampling call is equal to the sum of this parameter across all workers. If not provided, it will be automatically calculated. See cugraph_pyg.sampler.BaseDistributedSampler.

temporal_comparison: str (optional, default=’monotonically_decreasing’)

The comparison operator for temporal sampling (‘strictly_increasing’, ‘monotonically_increasing’, ‘strictly_decreasing’, ‘monotonically_decreasing’, ‘last’). Note that this should be ‘last’ for temporal_strategy=’last’. See cugraph_pyg.sampler.BaseDistributedSampler.

**kwargs

Other keyword arguments passed to the superclass.

Methods

__init__(data, num_neighbors[, ...])

data: Data, HeteroData, or Tuple[FeatureStore, GraphStore]

previous

cugraph_pyg.loader.link_loader.LinkLoader

next

cugraph_pyg.sampler.sampler.BaseSampler

On this page
  • LinkNeighborLoader
    • __init__()
NVIDIA NVIDIA
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2024-2026, NVIDIA Corporation.