What is the difference between apply_nodes(func=f) and g.ndata['x'] = f(nodes)?

As is said in title, i am confused about the difference between apply_nodes(func=f) and g.ndata[‘x’] = f(nodes)?

At current stage, there’s no difference between them.

The design of apply_nodes function is mainly for execution scheduling in more complex scenarios in the future. For example, apply_nodes may could split the whole ndata for user into batches to let the data fit in GPU memorys and do executions. However, we haven’t planned any kind of implementations like this, the design is just for future potential optimizations.