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
68e085ec
Unverified
Commit
68e085ec
authored
Mar 10, 2022
by
Matthias Fey
Committed by
GitHub
Mar 10, 2022
Browse files
PyTorch 1.11 Support (#277)
* check pytorch 1.11 * updatE * update * typo * update * typo
parent
3e36ea5c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
45 deletions
+88
-45
.github/workflows/linting.yml
.github/workflows/linting.yml
+36
-9
.github/workflows/testing.yml
.github/workflows/testing.yml
+11
-12
README.md
README.md
+1
-1
docs/requirements.txt
docs/requirements.txt
+0
-1
readthedocs.yml
readthedocs.yml
+1
-1
setup.cfg
setup.cfg
+13
-2
setup.py
setup.py
+23
-16
test/test_scatter.py
test/test_scatter.py
+3
-3
No files found.
.github/workflows/linting.yml
View file @
68e085ec
name
:
Linting
name
:
Linting
on
:
[
push
,
pull_request
]
on
:
push
:
branches
:
-
master
pull_request
:
jobs
:
jobs
:
flake8
:
flake8
:
runs-on
:
${{ matrix.os }}
runs-on
:
ubuntu-latest
strategy
:
matrix
:
os
:
[
ubuntu-latest
]
python-version
:
[
3.6
]
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Set up Python ${{ matrix.python-version }}
-
name
:
Set up Python
uses
:
actions/setup-python@v2
uses
:
actions/setup-python@v2
with
:
with
:
python-version
:
${{ matrix.python-version }}
python-version
:
3.9
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
...
@@ -26,3 +26,30 @@ jobs:
...
@@ -26,3 +26,30 @@ jobs:
-
name
:
Run linting
-
name
:
Run linting
run
:
|
run
:
|
flake8 .
flake8 .
pyroma
:
runs-on
:
ubuntu-latest
strategy
:
matrix
:
torch-version
:
[
1.11.0
]
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Set up Python
uses
:
actions/setup-python@v2
with
:
python-version
:
3.9
-
name
:
Install PyTorch ${{ matrix.torch-version }}
run
:
|
pip install torch==${{ matrix.torch-version}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
-
name
:
Install dependencies
run
:
|
pip install pyroma
-
name
:
Check package metadata
run
:
|
pyroma --min=10 .
.github/workflows/testing.yml
View file @
68e085ec
name
:
Testing
name
:
Testing
on
:
[
push
,
pull_request
]
on
:
push
:
branches
:
-
master
pull_request
:
jobs
:
jobs
:
...
@@ -8,10 +12,11 @@ jobs:
...
@@ -8,10 +12,11 @@ jobs:
runs-on
:
${{ matrix.os }}
runs-on
:
${{ matrix.os }}
strategy
:
strategy
:
fail-fast
:
false
matrix
:
matrix
:
os
:
[
ubuntu-latest
,
windows-latest
]
os
:
[
ubuntu-latest
,
windows-latest
]
python-version
:
[
3.
6
]
python-version
:
[
3.
7
]
torch-version
:
[
1.
9
.0
,
1.1
0
.0
]
torch-version
:
[
1.
10
.0
,
1.1
1
.0
]
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
...
@@ -30,16 +35,10 @@ jobs:
...
@@ -30,16 +35,10 @@ jobs:
-
name
:
Run test-suite
-
name
:
Run test-suite
run
:
|
run
:
|
pyt
hon setup.py test
pyt
est --cov --cov-report=xml
-
name
:
Generate coverage report
-
name
:
Upload coverage
if
:
success()
run
:
|
pip install coverage
coverage xml
-
name
:
Upload coverage report to codecov
uses
:
codecov/codecov-action@v1
uses
:
codecov/codecov-action@v1
if
:
success()
if
:
success()
with
:
with
:
fil
e
:
coverage.xml
f
a
il
_ci_if_error
:
false
README.md
View file @
68e085ec
...
@@ -141,7 +141,7 @@ tensor([[5, 5, 3, 4, 0, 1]
...
@@ -141,7 +141,7 @@ tensor([[5, 5, 3, 4, 0, 1]
## Running tests
## Running tests
```
```
py
thon setup.py
test
pytest
```
```
## C++ API
## C++ API
...
...
docs/requirements.txt
View file @
68e085ec
numpy
https://download.pytorch.org/whl/cpu/torch-1.5.0%2Bcpu-cp37-cp37m-linux_x86_64.whl
https://download.pytorch.org/whl/cpu/torch-1.5.0%2Bcpu-cp37-cp37m-linux_x86_64.whl
sphinx>=3
sphinx>=3
sphinx_rtd_theme
sphinx_rtd_theme
readthedocs.yml
View file @
68e085ec
...
@@ -4,7 +4,7 @@ build:
...
@@ -4,7 +4,7 @@ build:
image
:
latest
image
:
latest
python
:
python
:
version
:
3.
7
version
:
3.
8
system_packages
:
true
system_packages
:
true
install
:
install
:
-
requirements
:
docs/requirements.txt
-
requirements
:
docs/requirements.txt
...
...
setup.cfg
View file @
68e085ec
[metadata]
[metadata]
description-file = README.md
long_description=file: README.md
long_description_content_type=text/markdown
classifiers =
Development Status :: 5 - Production/Stable
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only
[aliases]
[aliases]
test = pytest
test = pytest
[tool:pytest]
[tool:pytest]
addopts = --capture=no
--cov
addopts = --capture=no
setup.py
View file @
68e085ec
import
os
import
sys
import
glob
import
glob
import
os
import
os.path
as
osp
import
os.path
as
osp
from
itertools
import
product
from
setuptools
import
setup
,
find_packages
import
platform
import
platform
import
sys
from
itertools
import
product
import
torch
import
torch
from
setuptools
import
find_packages
,
setup
from
torch.__config__
import
parallel_info
from
torch.__config__
import
parallel_info
from
torch.utils.cpp_extension
import
BuildExtension
from
torch.utils.cpp_extension
import
(
CUDA_HOME
,
BuildExtension
,
CppExtension
,
from
torch.utils.cpp_extension
import
CppExtension
,
CUDAExtension
,
CUDA_HOME
CUDAExtension
)
__version__
=
'2.0.9'
URL
=
'https://github.com/rusty1s/pytorch_scatter'
WITH_CUDA
=
torch
.
cuda
.
is_available
()
and
CUDA_HOME
is
not
None
WITH_CUDA
=
torch
.
cuda
.
is_available
()
and
CUDA_HOME
is
not
None
suffices
=
[
'cpu'
,
'cuda'
]
if
WITH_CUDA
else
[
'cpu'
]
suffices
=
[
'cpu'
,
'cuda'
]
if
WITH_CUDA
else
[
'cpu'
]
...
@@ -85,27 +88,31 @@ def get_extensions():
...
@@ -85,27 +88,31 @@ def get_extensions():
install_requires
=
[]
install_requires
=
[]
setup_requires
=
[]
tests_require
=
[
'pytest'
,
'pytest-runner'
,
'pytest-cov'
]
test_require
=
[
'pytest'
,
'pytest-cov'
,
]
setup
(
setup
(
name
=
'torch_scatter'
,
name
=
'torch_scatter'
,
version
=
'2.0.9'
,
version
=
__version__
,
description
=
'PyTorch Extension Library of Optimized Scatter Operations'
,
author
=
'Matthias Fey'
,
author
=
'Matthias Fey'
,
author_email
=
'matthias.fey@tu-dortmund.de'
,
author_email
=
'matthias.fey@tu-dortmund.de'
,
url
=
'https://github.com/rusty1s/pytorch_scatter'
,
url
=
URL
,
d
escription
=
'PyTorch Extension Library of Optimized Scatter Operations
'
,
d
ownload_url
=
f
'
{
URL
}
/archive/
{
__version__
}
.tar.gz
'
,
keywords
=
[
'pytorch'
,
'scatter'
,
'segment'
,
'gather'
],
keywords
=
[
'pytorch'
,
'scatter'
,
'segment'
,
'gather'
],
license
=
'MIT'
,
python_requires
=
'>=3.7'
,
python_requires
=
'>=3.6'
,
install_requires
=
install_requires
,
install_requires
=
install_requires
,
setup_requires
=
setup
_require
s
,
extras
_require
=
{
tests_require
=
test
s
_require
,
'test'
:
test_require
,
extras_require
=
{
'test'
:
tests_require
},
},
ext_modules
=
get_extensions
()
if
not
BUILD_DOCS
else
[],
ext_modules
=
get_extensions
()
if
not
BUILD_DOCS
else
[],
cmdclass
=
{
cmdclass
=
{
'build_ext'
:
'build_ext'
:
BuildExtension
.
with_options
(
no_python_abi_suffix
=
True
,
use_ninja
=
False
)
BuildExtension
.
with_options
(
no_python_abi_suffix
=
True
,
use_ninja
=
False
)
},
},
packages
=
find_packages
(),
packages
=
find_packages
(),
include_package_data
=
True
,
)
)
test/test_scatter.py
View file @
68e085ec
...
@@ -2,10 +2,10 @@ from itertools import product
...
@@ -2,10 +2,10 @@ from itertools import product
import
pytest
import
pytest
import
torch
import
torch
from
torch.autograd
import
gradcheck
import
torch_scatter
import
torch_scatter
from
torch.autograd
import
gradcheck
from
.utils
import
reductions
,
tensor
,
dtypes
,
devices
from
.utils
import
devices
,
dtypes
,
reductions
,
tensor
reductions
=
reductions
+
[
'mul'
]
reductions
=
reductions
+
[
'mul'
]
...
@@ -13,7 +13,7 @@ tests = [
...
@@ -13,7 +13,7 @@ tests = [
{
{
'src'
:
[
1
,
3
,
2
,
4
,
5
,
6
],
'src'
:
[
1
,
3
,
2
,
4
,
5
,
6
],
'index'
:
[
0
,
1
,
0
,
1
,
1
,
3
],
'index'
:
[
0
,
1
,
0
,
1
,
1
,
3
],
'dim'
:
0
,
'dim'
:
-
1
,
'sum'
:
[
3
,
12
,
0
,
6
],
'sum'
:
[
3
,
12
,
0
,
6
],
'add'
:
[
3
,
12
,
0
,
6
],
'add'
:
[
3
,
12
,
0
,
6
],
'mul'
:
[
2
,
60
,
1
,
6
],
'mul'
:
[
2
,
60
,
1
,
6
],
...
...
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