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-cluster
Commits
0fb1f1db
Commit
0fb1f1db
authored
Jul 27, 2019
by
rusty1s
Browse files
version up
parent
4fa1fb22
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
cpu/sampler.cpp
cpu/sampler.cpp
+1
-3
setup.py
setup.py
+1
-1
torch_cluster/__init__.py
torch_cluster/__init__.py
+1
-1
No files found.
cpu/sampler.cpp
View file @
0fb1f1db
#include <ATen/CPUGenerator.h>
#include <torch/extension.h>
at
::
Tensor
neighbor_sampler
(
at
::
Tensor
start
,
at
::
Tensor
cumdeg
,
size_t
size
,
float
factor
)
{
at
::
CPUGenerator
*
generator
=
at
::
detail
::
getDefaultCPUGenerator
();
auto
start_ptr
=
start
.
data
<
int64_t
>
();
auto
cumdeg_ptr
=
cumdeg
.
data
<
int64_t
>
();
...
...
@@ -24,7 +22,7 @@ at::Tensor neighbor_sampler(at::Tensor start, at::Tensor cumdeg, size_t size,
std
::
unordered_set
<
int64_t
>
set
;
if
(
size_i
<
0.7
*
float
(
num_neighbors
))
{
while
(
set
.
size
()
<
size_i
)
{
int64_t
z
=
generator
->
rand
om
()
%
num_neighbors
;
int64_t
z
=
rand
()
%
num_neighbors
;
set
.
insert
(
z
+
low
);
}
std
::
vector
<
int64_t
>
v
(
set
.
begin
(),
set
.
end
());
...
...
setup.py
View file @
0fb1f1db
...
...
@@ -29,7 +29,7 @@ if CUDA_HOME is not None:
[
'cuda/rw.cpp'
,
'cuda/rw_kernel.cu'
]),
]
__version__
=
'1.4.3
a1
'
__version__
=
'1.4.3'
url
=
'https://github.com/rusty1s/pytorch_cluster'
install_requires
=
[
'scipy'
]
...
...
torch_cluster/__init__.py
View file @
0fb1f1db
...
...
@@ -7,7 +7,7 @@ from .radius import radius, radius_graph
from
.rw
import
random_walk
from
.sampler
import
neighbor_sampler
__version__
=
'1.4.3
a1
'
__version__
=
'1.4.3'
__all__
=
[
'graclus_cluster'
,
...
...
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