gigl.utils.NodeAnchorLinkSplitter#

class gigl.utils.data_splitters.NodeAnchorLinkSplitter(*args, **kwargs)#

Bases: Protocol

Protocol that should be satisfied for anything that is used to split on edges.

The edges must be provided in COO format, as dense tensors. https://tbetcke.github.io/hpc_lecture_notes/sparse_data_structures.html

Args:

edge_index: The edges to split on in COO format. 2 x N

Returns:

The train (1 x X), val (1 X Y), test (1 x Z) nodes. X + Y + Z = N

Methods

__init__

__call__(edge_index: Tensor) Tuple[Tensor, Tensor, Tensor]#
__call__(edge_index: Mapping[EdgeType, Tensor]) Mapping[NodeType, Tuple[Tensor, Tensor, Tensor]]

Call self as a function.

__init__(*args, **kwargs)#
classmethod __init_subclass__(*args, **kwargs)#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__#

list of weak references to the object (if defined)