set_edge_lazy_featuresο
- class dgl.dataloading.base.set_edge_lazy_features(g, feature_names)[source]ο
Bases:
Assign lazy features to the
edata
of the input graph for prefetching optimization.When used in a
Sampler
, lazy features mark which data should be fetched before computation in model. See guide-minibatch-prefetching for a detailed explanation.If the graph is homogeneous, this is equivalent to:
g.edata.update({k: LazyFeature(k, g.edata[dgl.EID]) for k in feature_names})
If the graph is heterogeneous, this is equivalent to:
for type_, names in feature_names.items(): g.edges[type_].data.update( {k: LazyFeature(k, g.edges[type_].data[dgl.EID]) for k in names})
- Parameters:
See also
dgl.LazyFeature