Unverified Commit 6ceebaa7 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[GraphBolt] use str etype in data block (#6231)

parent ba61a566
...@@ -35,12 +35,9 @@ class DataBlock: ...@@ -35,12 +35,9 @@ class DataBlock:
The keys are tuples in the format '(edge_type, feature_name)', and the The keys are tuples in the format '(edge_type, feature_name)', and the
values represent the corresponding features. In the case of a homogeneous values represent the corresponding features. In the case of a homogeneous
graph where no edge types exist, 'edge_type' should be set to None. graph where no edge types exist, 'edge_type' should be set to None.
Note 'edge_type' are of format 'str:str:str'.
""" """
input_nodes: Union[ input_nodes: Union[torch.Tensor, Dict[str, torch.Tensor]] = None
torch.Tensor, Dict[Tuple[str, str, str], torch.Tensor]
] = None
"""A representation of input nodes in the outermost layer. Conatins all nodes """A representation of input nodes in the outermost layer. Conatins all nodes
in the 'sampled_subgraphs'. in the 'sampled_subgraphs'.
- If `input_nodes` is a tensor: It indicates the graph is homogeneous. - If `input_nodes` is a tensor: It indicates the graph is homogeneous.
......
...@@ -16,7 +16,7 @@ class LinkPredictionBlock(DataBlock): ...@@ -16,7 +16,7 @@ class LinkPredictionBlock(DataBlock):
node_pair: Union[ node_pair: Union[
Tuple[torch.Tensor, torch.Tensor], Tuple[torch.Tensor, torch.Tensor],
Dict[Tuple[str, str, str], Tuple[torch.Tensor, torch.Tensor]], Dict[str, Tuple[torch.Tensor, torch.Tensor]],
] = None ] = None
""" """
Representation of seed node pairs utilized in link prediction tasks. Representation of seed node pairs utilized in link prediction tasks.
...@@ -27,7 +27,7 @@ class LinkPredictionBlock(DataBlock): ...@@ -27,7 +27,7 @@ class LinkPredictionBlock(DataBlock):
type. type.
""" """
label: Union[torch.Tensor, Dict[Tuple[str, str, str], torch.Tensor]] = None label: Union[torch.Tensor, Dict[str, torch.Tensor]] = None
""" """
Labels associated with the link prediction task. Labels associated with the link prediction task.
- If `label` is a tensor: It indicates a homogeneous graph. The value are - If `label` is a tensor: It indicates a homogeneous graph. The value are
...@@ -36,9 +36,7 @@ class LinkPredictionBlock(DataBlock): ...@@ -36,9 +36,7 @@ class LinkPredictionBlock(DataBlock):
should correspond to given 'node_pair'. should correspond to given 'node_pair'.
""" """
negative_head: Union[ negative_head: Union[torch.Tensor, Dict[str, torch.Tensor]] = None
torch.Tensor, Dict[Tuple[str, str, str], torch.Tensor]
] = None
""" """
Representation of negative samples for the head nodes in the link Representation of negative samples for the head nodes in the link
prediction task. prediction task.
...@@ -48,9 +46,7 @@ class LinkPredictionBlock(DataBlock): ...@@ -48,9 +46,7 @@ class LinkPredictionBlock(DataBlock):
given type. given type.
""" """
negative_tail: Union[ negative_tail: Union[torch.Tensor, Dict[str, torch.Tensor]] = None
torch.Tensor, Dict[Tuple[str, str, str], torch.Tensor]
] = None
""" """
Representation of negative samples for the tail nodes in the link Representation of negative samples for the tail nodes in the link
prediction task. prediction task.
...@@ -62,24 +58,20 @@ class LinkPredictionBlock(DataBlock): ...@@ -62,24 +58,20 @@ class LinkPredictionBlock(DataBlock):
compacted_node_pair: Union[ compacted_node_pair: Union[
Tuple[torch.Tensor, torch.Tensor], Tuple[torch.Tensor, torch.Tensor],
Dict[Tuple[str, str, str], Tuple[torch.Tensor, torch.Tensor]], Dict[str, Tuple[torch.Tensor, torch.Tensor]],
] = None ] = None
""" """
Representation of compacted node pairs corresponding to 'node_pair', where Representation of compacted node pairs corresponding to 'node_pair', where
all node ids inside are compacted. all node ids inside are compacted.
""" """
compacted_negative_head: Union[ compacted_negative_head: Union[torch.Tensor, Dict[str, torch.Tensor]] = None
torch.Tensor, Dict[Tuple[str, str, str], torch.Tensor]
] = None
""" """
Representation of compacted nodes corresponding to 'negative_head', where Representation of compacted nodes corresponding to 'negative_head', where
all node ids inside are compacted. all node ids inside are compacted.
""" """
compacted_negative_tail: Union[ compacted_negative_tail: Union[torch.Tensor, Dict[str, torch.Tensor]] = None
torch.Tensor, Dict[Tuple[str, str, str], torch.Tensor]
] = None
""" """
Representation of compacted nodes corresponding to 'negative_tail', where Representation of compacted nodes corresponding to 'negative_tail', where
all node ids inside are compacted. all node ids inside are compacted.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment