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-sparse
Commits
a72001c5
"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "f0a588b8e2783cea0bd1a6b6d7ac85844d91b268"
Commit
a72001c5
authored
May 18, 2020
by
rusty1s
Browse files
fix broadcasting
parent
19a5fc17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
torch_sparse/sample.py
torch_sparse/sample.py
+3
-1
No files found.
torch_sparse/sample.py
View file @
a72001c5
...
@@ -15,7 +15,9 @@ def sample(src: SparseTensor, num_neighbors: int,
...
@@ -15,7 +15,9 @@ def sample(src: SparseTensor, num_neighbors: int,
rowptr
=
rowptr
[
subset
]
rowptr
=
rowptr
[
subset
]
rand
=
torch
.
rand
((
rowcount
.
size
(
0
),
num_neighbors
),
device
=
col
.
device
)
rand
=
torch
.
rand
((
rowcount
.
size
(
0
),
num_neighbors
),
device
=
col
.
device
)
rand
=
rand
.
mul_
(
rowcount
.
to
(
rand
.
dtype
)).
to
(
torch
.
long
).
add_
(
rowptr
)
rand
.
mul_
(
rowcount
.
to
(
rand
.
dtype
).
view
(
-
1
,
1
))
rand
=
rand
.
to
(
torch
.
long
)
rand
.
add_
(
rowptr
.
view
(
-
1
,
1
))
return
col
[
rand
]
return
col
[
rand
]
...
...
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