FeatureFetcherΒΆ

class dgl.graphbolt.FeatureFetcher(datapipe, feature_store, node_feature_keys=None, edge_feature_keys=None)[source]ΒΆ

Bases: torch.utils.data.datapipes.datapipe.IterDataPipe[torch.utils.data.datapipes.iter.callable.T_co]

A feature fetcher used to fetch features for node/edge in graphbolt.

Functional name: fetch_feature.

Parameters
  • datapipe (DataPipe) – The datapipe.

  • feature_store (FeatureStore) – A storage for features, support read and update.

  • node_feature_keys (List[str] or Dict[str, List[str]]) – Node features keys indicates the node features need to be read. - If node_features is a list: It means the graph is homogeneous graph, and the β€˜str’ inside are feature names. - If node_features is a dictionary: The keys should be node type and the values are lists of feature names.

  • edge_feature_keys (List[str] or Dict[str, List[str]]) – Edge features name indicates the edge features need to be read. - If edge_features is a list: It means the graph is homogeneous graph, and the β€˜str’ inside are feature names. - If edge_features is a dictionary: The keys are edge types, following the format β€˜str:str:str’, and the values are lists of feature names.