graphstorm.gsf.get_node_feat_size
- graphstorm.gsf.get_node_feat_size(g, node_feat_names)
Get the overall feature size of each node type with feature names specified in the
node_feat_names. If a node type has multiple features, the returned feature size will be the sum of the sizes of these features for that node type. If a node type has multiple groups of features, it returns the sizes of different feature groups.Changed in version 0.5.0: When node_feat_names is a dict, its value(s) can be a list of str or a list of FeatureGroups. The return value can be a dict of int or FeatureGroupSize, respectively.
Parameters
- gDistGraph
A DGL distributed graph.
- node_feat_namesstr, or a dict
The node feature names. A string indicates that all nodes share the same feature name. A dictionary indicates that each node type has different node feature names. When the value of a key (node type) is a list of strings, it indicates that the node type has only one group of features. When the value is a list of FeatureGroups, it indicates that the node type has more than one group of features, which will be encoded separately.
Returns
- node_feat_size: dict of int or FeatureGroupSize
The feature size for the node types and feature names specified in the
node_feat_names. If feature name is not specified, the feature size will be 0.