sample doesn't work correctly when nodes are repeated in input
See original GitHub issueWorking on https://github.com/pyg-team/pytorch_geometric/issues/4026 I discovered that this sampling function does not work properly when the input_node
array has duplicates. In this case the number of samples can be > number of edges and the index i
doesn’t do what you’d expect it to.
Another strange behaviour is when using the function as
torch.ops.torch_sparse.neighbor_sample(
torch.Tensor([0, 1, 2, 3]).type(torch.long),
torch.Tensor([1, 0, 1]).type(torch.long),
torch.Tensor([0, 2]).type(torch.long),
[1],
False,
False,
)
The returned values are
(tensor([0, 2, 1]), tensor([2, 2, 0]), tensor([0, 1, 2]), tensor([0, 2, 1]))
but the (row, col) combination (2, 0) and (0, 2) don’t make sense, they’re not part of the original adjacency matrix.
I’m happy to dive in a bit deeper and figure out a fix (for at least the first issue, the second issue I am not sure if its actually a problem or not yet), but thought I’d check first if this is known or maybe my understanding is incorrect.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Problems when developing message flows with file nodes - IBM
Solution: If the input messages have unique keys, modify your flow to ignore duplicate records. If the messages do not have unique keys...
Read more >XPath contains(text(),'some string') doesn't work when used ...
An argument is converted to type string as if by calling the string function. string() function returns string-value of the first node: A...
Read more >Top 10 Most Common Node.js Developer Mistakes - Toptal
For brevity, we used simpler examples here, but reality is often worse. Mistake #4: Expecting Callbacks to Run Synchronously. Asynchronous programming with ...
Read more >Connect nodes at same level - GeeksforGeeks
Given a Binary Tree, The task is to connect all the adjacent nodes at the same level starting from the left-most node of...
Read more >Using the Node-Red Function Node- Beginners Guide
The function node is used to run JavaScript code. The function node accepts a msg object as input and can return 0 or...
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
ohh I see, the row/col are relative to the nodes in the output? If so, then agreed.
And if this is the case… then actually the first issue is also a non-issue. Sorry for the false alarm!
Closing this one as we’ve agreed not to do anything about it in pytorch_sparse, thanks @rusty1s