Scatter max bug with negative numbers
See original GitHub issueHi,
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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >
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
It is expected behaviour. It can be bypassed by passing, e.g., fill_value=-1e16 as additional argument.
I see, the
fill_value
changed recently to a large negative value. Callingscatter_max(src, index, fill_value=0)
should print out the desired output. I will change theREADME
accordingly.