gigl.types.LoadedGraphTensors#

class gigl.types.data.LoadedGraphTensors(node_ids: Union[torch.Tensor, dict[NewType.<locals>.new_type, torch.Tensor]], node_features: Union[torch.Tensor, dict[NewType.<locals>.new_type, torch.Tensor], NoneType], edge_index: Union[torch.Tensor, dict[gigl.src.common.types.graph_data.EdgeType, torch.Tensor]], edge_features: Union[torch.Tensor, dict[gigl.src.common.types.graph_data.EdgeType, torch.Tensor], NoneType], positive_label: Union[torch.Tensor, dict[gigl.src.common.types.graph_data.EdgeType, torch.Tensor], NoneType], negative_label: Union[torch.Tensor, dict[gigl.src.common.types.graph_data.EdgeType, torch.Tensor], NoneType])#

Bases: object

Methods

__init__

treat_labels_as_edges

Convert positive and negative labels to edges.

__eq__(other)#

Return self==value.

__hash__ = None#
__init__(node_ids: Tensor | dict[NodeType, Tensor], node_features: Tensor | dict[NodeType, Tensor] | None, edge_index: Tensor | dict[EdgeType, Tensor], edge_features: Tensor | dict[EdgeType, Tensor] | None, positive_label: Tensor | dict[EdgeType, Tensor] | None, negative_label: Tensor | dict[EdgeType, Tensor] | None) None#
__repr__()#

Return repr(self).

__weakref__#

list of weak references to the object (if defined)

treat_labels_as_edges() None#

Convert positive and negative labels to edges. Converts this object in-place to a “heterogeneous” representation.

This requires the following conditions and will throw if they are not met:
  1. The node_ids, node_features, edge_index, and edge_features are not dictionaries (we loaded a homogeneous graph).

  2. The positive_label and negative_label are not None and are Tensors, not dictionaries.