[Feat request] Allow multiple built-in function usage in .update_all
See original GitHub issue🚀 Feature
support multiple built-in function at once: g.update_all( [m_func1, m_func2] , [r_func1, r_func2] )
Motivation
Main motivation would be better performance, since I imagine it would eliminate considerable overhead. If there is no overhead, then the improvement would be only having a cleaner code.
Pitch
Desired solution
import dgl
import dgl.function as fn
import torch
g = dgl.heterograph({('user', 'follows', 'user'): ([0, 1, 2], [1, 2, 2])})
g.nodes['user'].data['h'] = torch.tensor([[0.], [1.], [2.]])
g.nodes['user'].data['x'] = torch.tensor([[0.], [1.], [2.]])
#CURRENT APPROACH
g['follows'].update_all(fn.copy_u('h', 'm'), fn.sum('m', 'h_new'), etype='follows')
g['follows'].update_all(fn.copy_u('x', 'm2'), fn.sum('m2', 'h_new'), etype='follows')
#DESIRED APPROACH
g['follows'].update_all([fn.copy_src('h', 'm'), fn.copy_src('x', 'm2')], [fn.sum('m', 'h_new'), fn.sum('m2', 'h_new2')], etype='follows')
#>>Not supported. Throws error: `TypeError: 'list' object is not callable`
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Updating record when referenced by multiple data structures
The update function is given the old Person , the updated Person , and will update the table only if the relevant details...
Read more >Update and UpdateIf functions in Power Apps - Microsoft Learn
Use the Update function to replace an entire record in a data ... Collections allow duplicate records, so multiple records might match.
Read more >What's New in PHP 8.1? Features, Changes, Improvements ...
Let's start by covering all the new features in PHP 8.1. ... They both ensure that the function or method doesn't return a...
Read more >Updates for Supabase Functions
Supabase will support several different targets. HTTP/Webhooks: Send HTTP requests directly from your Postgres Database. AWS Lambda/Google Cloud ...
Read more >Business Rules Technical Best Practices - ServiceNow
Business Rules are an effective way to double-check critical input. For example, a request allows users to reserve items. When users fill out...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, currently we won’t support this fusion since we don’t have much to improve on the performance.
This issue is closed due to lack of activity. Feel free to reopen it if you still have questions.