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
19deedfc
Commit
19deedfc
authored
Feb 13, 2020
by
rusty1s
Browse files
rquire python 3.6
parent
3c4582ed
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
39 deletions
+26
-39
.travis.yml
.travis.yml
+4
-17
setup.py
setup.py
+3
-3
torch_scatter/__init__.py
torch_scatter/__init__.py
+10
-10
torch_scatter/scatter.py
torch_scatter/scatter.py
+3
-3
torch_scatter/segment_coo.py
torch_scatter/segment_coo.py
+3
-3
torch_scatter/segment_csr.py
torch_scatter/segment_csr.py
+3
-3
No files found.
.travis.yml
View file @
19deedfc
...
@@ -17,14 +17,10 @@ env:
...
@@ -17,14 +17,10 @@ env:
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101
#
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu
-
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
-
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cpu
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu92
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu100
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu101
jobs
:
jobs
:
exclude
:
# Exclude *all* macOS CUDA jobs and Windows CUDA 9.2/10.0 jobs.
exclude
:
# Exclude *all* macOS CUDA jobs and Windows CUDA 9.2/10.0 jobs.
...
@@ -46,12 +42,6 @@ jobs:
...
@@ -46,12 +42,6 @@ jobs:
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
-
os
:
osx
-
os
:
osx
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
-
os
:
osx
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu92
-
os
:
osx
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu100
-
os
:
osx
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu101
-
os
:
windows
-
os
:
windows
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
-
os
:
windows
-
os
:
windows
...
@@ -64,24 +54,21 @@ jobs:
...
@@ -64,24 +54,21 @@ jobs:
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
-
os
:
windows
-
os
:
windows
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
-
os
:
windows
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu92
-
os
:
windows
env
:
TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu100
install
:
install
:
-
source script/cuda.sh
-
source script/cuda.sh
-
source script/conda.sh
-
source script/conda.sh
-
pip install flake8 codecov
-
python setup.py install
-
python setup.py install
script
:
script
:
-
if [ "${PYTHON_VERSION}" != "3.5" ]; then pip install flake8 &&
flake8 .
; fi
-
flake8 .
-
python setup.py test
-
python setup.py test
after_success
:
after_success
:
-
python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}
-
python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}
-
python script/rename_wheel.py ${IDX}
-
python script/rename_wheel.py ${IDX}
-
pip install codecov &&
codecov
-
codecov
deploy
:
deploy
:
provider
:
s3
provider
:
s3
region
:
eu-central-1
region
:
eu-central-1
...
...
setup.py
View file @
19deedfc
...
@@ -37,11 +37,11 @@ def get_extensions():
...
@@ -37,11 +37,11 @@ def get_extensions():
sources
=
[
main
]
sources
=
[
main
]
path
=
osp
.
join
(
extensions_dir
,
'cpu'
,
name
+
'
_cpu.cpp'
)
path
=
osp
.
join
(
extensions_dir
,
'cpu'
,
f
'
{
name
}
_cpu.cpp'
)
if
osp
.
exists
(
path
):
if
osp
.
exists
(
path
):
sources
+=
[
path
]
sources
+=
[
path
]
path
=
osp
.
join
(
extensions_dir
,
'cuda'
,
name
+
'
_cuda.cu'
)
path
=
osp
.
join
(
extensions_dir
,
'cuda'
,
f
'
{
name
}
_cuda.cu'
)
if
WITH_CUDA
and
osp
.
exists
(
path
):
if
WITH_CUDA
and
osp
.
exists
(
path
):
sources
+=
[
path
]
sources
+=
[
path
]
...
@@ -70,7 +70,7 @@ setup(
...
@@ -70,7 +70,7 @@ setup(
description
=
'PyTorch Extension Library of Optimized Scatter Operations'
,
description
=
'PyTorch Extension Library of Optimized Scatter Operations'
,
keywords
=
[
'pytorch'
,
'scatter'
,
'segment'
,
'gather'
],
keywords
=
[
'pytorch'
,
'scatter'
,
'segment'
,
'gather'
],
license
=
'MIT'
,
license
=
'MIT'
,
python_requires
=
'>=3.
5
'
,
python_requires
=
'>=3.
6
'
,
install_requires
=
install_requires
,
install_requires
=
install_requires
,
setup_requires
=
setup_requires
,
setup_requires
=
setup_requires
,
tests_require
=
tests_require
,
tests_require
=
tests_require
,
...
...
torch_scatter/__init__.py
View file @
19deedfc
# flake8: noqa
# flake8: noqa
import
glo
b
import
importli
b
import
os.path
as
osp
import
os.path
as
osp
import
torch
import
torch
...
@@ -9,16 +9,16 @@ __version__ = '2.0.3'
...
@@ -9,16 +9,16 @@ __version__ = '2.0.3'
expected_torch_version
=
(
1
,
4
)
expected_torch_version
=
(
1
,
4
)
try
:
try
:
torch
.
ops
.
load_library
(
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
glob
.
glob
(
osp
.
join
(
osp
.
dirname
(
__file__
)
,
'_version.*'
))[
0
]
)
'_version'
,
[
osp
.
dirname
(
__file__
)
]).
origin
)
except
OSError
as
e
:
except
OSError
as
e
:
if
'undefined symbol'
in
str
(
e
):
if
'undefined symbol'
in
str
(
e
):
major
,
minor
=
[
int
(
x
)
for
x
in
torch
.
__version__
.
split
(
'.'
)[:
2
]]
major
,
minor
=
[
int
(
x
)
for
x
in
torch
.
__version__
.
split
(
'.'
)[:
2
]]
t_major
,
t_minor
=
expected_torch_version
t_major
,
t_minor
=
expected_torch_version
if
major
!=
t_major
or
(
major
==
t_major
and
minor
!=
t_minor
):
if
major
!=
t_major
or
(
major
==
t_major
and
minor
!=
t_minor
):
raise
RuntimeError
(
raise
RuntimeError
(
'Expected PyTorch version {
}.{
} but found
version
'
f
'Expected PyTorch version
{
t_major
}
.
{
t_minor
}
but found '
'{}.{}.'
.
format
(
t_major
,
t_minor
,
major
,
minor
)
)
f
'version
{
major
}
.
{
minor
}
.'
)
raise
OSError
(
e
)
raise
OSError
(
e
)
from
.scatter
import
(
scatter_sum
,
scatter_add
,
scatter_mean
,
scatter_min
,
from
.scatter
import
(
scatter_sum
,
scatter_add
,
scatter_mean
,
scatter_min
,
...
@@ -43,11 +43,11 @@ if cuda_version != -1 and torch.version.cuda is not None: # pragma: no cover
...
@@ -43,11 +43,11 @@ if cuda_version != -1 and torch.version.cuda is not None: # pragma: no cover
if
t_major
!=
major
or
t_minor
!=
minor
:
if
t_major
!=
major
or
t_minor
!=
minor
:
raise
RuntimeError
(
raise
RuntimeError
(
'Detected that PyTorch and torch_scatter were compiled with '
f
'Detected that PyTorch and torch_scatter were compiled with '
'different CUDA versions. PyTorch has CUDA version
={}.{} and
'
f
'different CUDA versions. PyTorch has CUDA version '
'
torch_scatter has CUDA version
={}.{}. Please reinstall the
'
f
'
{
t_major
}
.
{
t_minor
}
and
torch_scatter has CUDA version '
'torch_scatter that matches your PyTorch install.'
.
format
(
f
'
{
major
}
.
{
minor
}
. Please reinstall the torch_scatter that '
t_major
,
t_minor
,
major
,
minor
)
)
f
'matches your PyTorch install.'
)
__all__
=
[
__all__
=
[
'scatter_sum'
,
'scatter_sum'
,
...
...
torch_scatter/scatter.py
View file @
19deedfc
import
glo
b
import
importli
b
import
os.path
as
osp
import
os.path
as
osp
from
typing
import
Optional
,
Tuple
from
typing
import
Optional
,
Tuple
...
@@ -6,8 +6,8 @@ import torch
...
@@ -6,8 +6,8 @@ import torch
from
.utils
import
broadcast
from
.utils
import
broadcast
torch
.
ops
.
load_library
(
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
glob
.
glob
(
osp
.
join
(
osp
.
dirname
(
__file__
)
,
'_scatter.*'
))[
0
]
)
'_scatter'
,
[
osp
.
dirname
(
__file__
)
]).
origin
)
@
torch
.
jit
.
script
@
torch
.
jit
.
script
...
...
torch_scatter/segment_coo.py
View file @
19deedfc
import
glo
b
import
importli
b
import
os.path
as
osp
import
os.path
as
osp
from
typing
import
Optional
,
Tuple
from
typing
import
Optional
,
Tuple
import
torch
import
torch
torch
.
ops
.
load_library
(
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
glob
.
glob
(
osp
.
join
(
osp
.
dirname
(
__file__
)
,
'_segment_coo.*'
))[
0
]
)
'_segment_coo'
,
[
osp
.
dirname
(
__file__
)
]).
origin
)
@
torch
.
jit
.
script
@
torch
.
jit
.
script
...
...
torch_scatter/segment_csr.py
View file @
19deedfc
import
glo
b
import
importli
b
import
os.path
as
osp
import
os.path
as
osp
from
typing
import
Optional
,
Tuple
from
typing
import
Optional
,
Tuple
import
torch
import
torch
torch
.
ops
.
load_library
(
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
glob
.
glob
(
osp
.
join
(
osp
.
dirname
(
__file__
)
,
'_segment_csr.*'
))[
0
]
)
'_segment_csr'
,
[
osp
.
dirname
(
__file__
)
]).
origin
)
@
torch
.
jit
.
script
@
torch
.
jit
.
script
...
...
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