dgl.NodeFlow.set_n_initializer

NodeFlow.set_n_initializer(initializer, layer_id='__ALL__', field=None)[source]

Set the initializer for empty node features.

Initializer is a callable that returns a tensor given the shape, data type and device context.

When a subset of the nodes are assigned a new feature, initializer is used to create feature for rest of the nodes.

Parameters:
  • initializer (callable) – The initializer.
  • layer_id (int) – the layer to set the initializer.
  • field (str, optional) – The feature field name. Default is set an initializer for all the feature fields.