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.

Scatter max bug with negative numbers

See original GitHub issue

Hi,

I tracked down a bug in version 1.0.4 when computing scatter_max on negative numbers. Is it fixed in master? Or is it expected behaviour?

>>> import torch
>>> import torch_scatter
>>> torch_scatter.scatter_max(torch.tensor([-.1, -.2, -.3]), torch.tensor([0, 1, 0]))
(tensor([0., 0.]), tensor([-1, -1])) # instead of (tensor([-.1, -.2]), tensor([0, 1]))

For now I shift my values to positive, apply max then shift back.

Thank you

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
rusty1scommented, Feb 12, 2019

It is expected behaviour. It can be bypassed by passing, e.g., fill_value=-1e16 as additional argument.

0reactions
rusty1scommented, Sep 2, 2019

I see, the fill_value changed recently to a large negative value. Calling scatter_max(src, index, fill_value=0) should print out the desired output. I will change the README accordingly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

negative values not displaying in y axis or data labels on chart
I generate an x-y scatter plot with distance on the x axis and time on the y. The points appear on the graph...
Read more >
Smart axis confused by negative values | Infragistics Forums
Hi! I'm using Infragistics2.Win.UltraWinChart.v5.3.dll (version 5.3.20053.73) to produce a composite chart including one line chart and one scatter.
Read more >
Getting error when asking from max and min for negative values.
I have two vector of negative numbers (log values). The first is fine as it has a postive max value and a negative...
Read more >
python - Bar Chart: How to choose color if value is positive vs ...
I want to plot the positive colors 'green' and the negative values 'red' (very original...lol). I'm not sure how to pass if >...
Read more >
Fit behaviour in volume wrangle not as expected | Forums | SideFX
since scatter uses the volume value as density, it scatters only in ... by fitting 0-max, to 0-1 you literally just clamp the...
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