question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
VoVAllencommented, Sep 6, 2021

Hi, currently we won’t support this fusion since we don’t have much to improve on the performance.

0reactions
github-actions[bot]commented, Feb 20, 2022

This issue is closed due to lack of activity. Feel free to reopen it if you still have questions.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found