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
08dda1ad
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "0c18d02cc9c4803ed15d46ffc7521b91135cb300"
Commit
08dda1ad
authored
Sep 30, 2019
by
rusty1s
Browse files
coverage
parent
7d5034ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
torch_scatter/utils/gen.py
torch_scatter/utils/gen.py
+2
-1
No files found.
torch_scatter/utils/gen.py
View file @
08dda1ad
...
@@ -20,7 +20,8 @@ def gen(src, index, dim=-1, out=None, dim_size=None, fill_value=0):
...
@@ -20,7 +20,8 @@ def gen(src, index, dim=-1, out=None, dim_size=None, fill_value=0):
index_size
[
dim
]
=
src
.
size
(
dim
)
index_size
[
dim
]
=
src
.
size
(
dim
)
if
index
.
numel
()
>
0
:
if
index
.
numel
()
>
0
:
index
=
index
.
view
(
index_size
).
expand_as
(
src
)
index
=
index
.
view
(
index_size
).
expand_as
(
src
)
else
:
# PyTorch has a bug when view is used on zero-element tensors.
else
:
# pragma: no cover
# PyTorch has a bug when view is used on zero-element tensors.
index
=
src
.
new_empty
(
index_size
,
dtype
=
torch
.
long
)
index
=
src
.
new_empty
(
index_size
,
dtype
=
torch
.
long
)
# Broadcasting capabilties: Expand dimensions to match.
# Broadcasting capabilties: Expand dimensions to match.
...
...
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