Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-scatter
Commits
49f7b401
Unverified
Commit
49f7b401
authored
Apr 01, 2020
by
silent567
Committed by
GitHub
Apr 01, 2020
Browse files
Update logsumexp.py
Debugging for the corner cases involving -inf.
parent
943cfd59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
torch_scatter/composite/logsumexp.py
torch_scatter/composite/logsumexp.py
+1
-3
No files found.
torch_scatter/composite/logsumexp.py
View file @
49f7b401
...
@@ -25,9 +25,7 @@ def scatter_logsumexp(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
...
@@ -25,9 +25,7 @@ def scatter_logsumexp(src: torch.Tensor, index: torch.Tensor, dim: int = -1,
size
=
src
.
size
()
size
=
src
.
size
()
size
[
dim
]
=
dim_size
size
[
dim
]
=
dim_size
max_value_per_index
=
torch
.
full
(
size
,
float
(
'-inf'
),
dtype
=
src
.
dtype
,
max_value_per_index
=
scatter_max
(
src
,
index
,
dim
=
dim
,
dim_size
=
dim_size
)[
0
]
device
=
src
.
device
)
scatter_max
(
src
,
index
,
dim
,
max_value_per_index
,
dim_size
)[
0
]
max_per_src_element
=
max_value_per_index
.
gather
(
dim
,
index
)
max_per_src_element
=
max_value_per_index
.
gather
(
dim
,
index
)
recentered_scores
=
src
-
max_per_src_element
recentered_scores
=
src
-
max_per_src_element
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment