BatchedDGLGraph.local_var() does not return a BatchedDGLGraph object?

I find it a little unintuitive and inconvenient that BatchedDGLGraph.local_var() does not return a BatchedDGLGraph object. Both local_var and local_scope can be used to avoid accidentally overriding existing feature data. But I prefer using local_var because using local_scope needs one extra indentation. But since local_var does not return a BatchedDGLGraph object, I cannot perform operations like broadcast_nodes. Could BatchedDGLGraph.local_var() be changed to return a BatchedDGLGraph object? What’s the reason for the current implementation?

Hi, thanks for your report and I agree with you. This should be fixed in PR 1146. If urgent, you may install from source and modify your local code directly.