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
cd156a4e
"...python/git@developer.sourcefind.cn:change/sglang.git" did not exist on "2d5605e89bd858e4a6e3b631c6cb15aaec2e8e7a"
Commit
cd156a4e
authored
Feb 11, 2020
by
rusty1s
Browse files
loadmodule
parent
fa27e1fd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
45 deletions
+56
-45
.travis.yml
.travis.yml
+37
-36
MANIFEST.in
MANIFEST.in
+1
-0
torch_scatter/__init__.py
torch_scatter/__init__.py
+9
-3
torch_scatter/scatter.py
torch_scatter/scatter.py
+3
-2
torch_scatter/segment_coo.py
torch_scatter/segment_coo.py
+3
-2
torch_scatter/segment_csr.py
torch_scatter/segment_csr.py
+3
-2
No files found.
.travis.yml
View file @
cd156a4e
...
@@ -10,34 +10,34 @@ env:
...
@@ -10,34 +10,34 @@ env:
jobs
:
jobs
:
include
:
include
:
-
name
:
linux/cpu
#
- name: linux/cpu
os
:
linux
#
os: linux
language
:
python
#
language: python
python
:
3.7.6
#
python: 3.7.6
env
:
#
env:
-
TORCH=${TORCH_VERSION}+cpu
#
- TORCH=${TORCH_VERSION}+cpu
-
name
:
linux/cu92
#
- name: linux/cu92
os
:
linux
#
os: linux
language
:
python
#
language: python
python
:
3.7.6
#
python: 3.7.6
env
:
#
env:
-
FORCE_CUDA=1
#
- FORCE_CUDA=1
-
CUDA_SHORT=9.2
#
- CUDA_SHORT=9.2
-
CUDA=9.2.148-1
#
- CUDA=9.2.148-1
-
UBUNTU_VERSION=ubuntu1604
#
- UBUNTU_VERSION=ubuntu1604
-
CUBLAS=cuda-cublas-dev-9-2
#
- CUBLAS=cuda-cublas-dev-9-2
-
TORCH=${TORCH_VERSION}+cu92
#
- TORCH=${TORCH_VERSION}+cu92
-
name
:
linux/cu100
#
- name: linux/cu100
os
:
linux
#
os: linux
language
:
python
#
language: python
python
:
3.7.6
#
python: 3.7.6
env
:
#
env:
-
FORCE_CUDA=1
#
- FORCE_CUDA=1
-
CUDA_SHORT=10.0
#
- CUDA_SHORT=10.0
-
CUDA=10.0.130-1
#
- CUDA=10.0.130-1
-
UBUNTU_VERSION=ubuntu1804
#
- UBUNTU_VERSION=ubuntu1804
-
CUBLAS=cuda-cublas-dev-10-0
#
- CUBLAS=cuda-cublas-dev-10-0
-
TORCH=${TORCH_VERSION}+cu100
#
- TORCH=${TORCH_VERSION}+cu100
-
name
:
linux/cu101
-
name
:
linux/cu101
os
:
linux
os
:
linux
language
:
python
language
:
python
...
@@ -49,12 +49,12 @@ jobs:
...
@@ -49,12 +49,12 @@ jobs:
-
UBUNTU_VERSION=ubuntu1804
-
UBUNTU_VERSION=ubuntu1804
-
CUBLAS=libcublas-dev
-
CUBLAS=libcublas-dev
-
TORCH=${TORCH_VERSION}
-
TORCH=${TORCH_VERSION}
-
name
:
macosx/cpu
#
- name: macosx/cpu
os
:
osx
#
os: osx
osx_image
:
xcode11.3
#
osx_image: xcode11.3
language
:
shell
#
language: shell
env
:
#
env:
-
TORCH=${TORCH_VERSION}
#
- TORCH=${TORCH_VERSION}
-
name
:
windows/cpu
-
name
:
windows/cpu
os
:
windows
os
:
windows
language
:
shell
language
:
shell
...
@@ -98,17 +98,18 @@ jobs:
...
@@ -98,17 +98,18 @@ jobs:
# - choco install python --version 3.7.6
# - choco install python --version 3.7.6
install
:
install
:
-
if [ "${TRAVIS_OS_NAME}" = "windows" ]; then echo "wadawd"; alias python3=python; fi
-
source install.sh
-
source install.sh
-
pip3 install numpy
-
pip3 install numpy
-
pip3 install torch==${TORCH} -f https://download.pytorch.org/whl/torch_stable.html
-
pip3 install torch==${TORCH} -f https://download.pytorch.org/whl/torch_stable.html
-
pip3 install flake8
-
pip3 install flake8
-
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${FORCE_CUDA}" == "0" ]; then pip3 install codecov; fi
-
python3 setup.py install || python setup.py install
-
python3 setup.py install || python setup.py install
script
:
script
:
-
flake8 .
-
flake8 .
-
python3 setup.py test || python setup.py test
-
python3 setup.py test || python setup.py test
-
python3 setup.py bdist_wheel || python setup.py bdist_wheel
-
python3 setup.py bdist_wheel || python setup.py bdist_wheel
# - ls dist
after_success
:
-
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${FORCE_CUDA}" == "0" ]; then codecov; fi
notifications
:
notifications
:
email
:
false
email
:
false
MANIFEST.in
View file @
cd156a4e
include README.md
include LICENSE
include LICENSE
recursive-include csrc *
recursive-include csrc *
torch_scatter/__init__.py
View file @
cd156a4e
import
importlib
import
os.path
as
osp
import
os.path
as
osp
import
torch
import
torch
...
@@ -13,16 +14,18 @@ from .segment_coo import (segment_sum_coo, segment_add_coo, segment_mean_coo,
...
@@ -13,16 +14,18 @@ from .segment_coo import (segment_sum_coo, segment_add_coo, segment_mean_coo,
from
.composite
import
(
scatter_std
,
scatter_logsumexp
,
scatter_softmax
,
from
.composite
import
(
scatter_std
,
scatter_logsumexp
,
scatter_softmax
,
scatter_log_softmax
)
scatter_log_softmax
)
torch
.
ops
.
load_library
(
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
osp
.
join
(
osp
.
dirname
(
osp
.
abspath
(
__file__
)),
'_version.so'
)
)
'_version'
,
[
osp
.
dirname
(
__file__
)]).
origin
)
cuda_version
=
torch
.
ops
.
torch_scatter
.
cuda_version
()
cuda_version
=
torch
.
ops
.
torch_scatter
.
cuda_version
()
if
cuda_version
!=
1
and
torch
.
version
.
cuda
is
not
None
:
if
cuda_version
!=
-
1
and
torch
.
version
.
cuda
is
not
None
:
# pragma: no cover
if
cuda_version
<
10000
:
if
cuda_version
<
10000
:
major
,
minor
=
int
(
str
(
cuda_version
)[
0
]),
int
(
str
(
cuda_version
)[
2
])
major
,
minor
=
int
(
str
(
cuda_version
)[
0
]),
int
(
str
(
cuda_version
)[
2
])
else
:
else
:
major
,
minor
=
int
(
str
(
cuda_version
)[
0
:
2
]),
int
(
str
(
cuda_version
)[
3
])
major
,
minor
=
int
(
str
(
cuda_version
)[
0
:
2
]),
int
(
str
(
cuda_version
)[
3
])
t_major
,
t_minor
=
[
int
(
x
)
for
x
in
torch
.
version
.
cuda
.
split
(
'.'
)]
t_major
,
t_minor
=
[
int
(
x
)
for
x
in
torch
.
version
.
cuda
.
split
(
'.'
)]
cuda_version
=
str
(
major
)
+
'.'
+
str
(
minor
)
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 '
'Detected that PyTorch and torch_scatter were compiled with '
...
@@ -30,6 +33,8 @@ if cuda_version != 1 and torch.version.cuda is not None:
...
@@ -30,6 +33,8 @@ if cuda_version != 1 and torch.version.cuda is not None:
'torch_scatter has CUDA version={}.{}. Please reinstall the '
'torch_scatter has CUDA version={}.{}. Please reinstall the '
'torch_scatter that matches your PyTorch install.'
.
format
(
'torch_scatter that matches your PyTorch install.'
.
format
(
t_major
,
t_minor
,
major
,
minor
))
t_major
,
t_minor
,
major
,
minor
))
else
:
cuda_version
=
None
__version__
=
'2.0.3'
__version__
=
'2.0.3'
...
@@ -59,5 +64,6 @@ __all__ = [
...
@@ -59,5 +64,6 @@ __all__ = [
'scatter_softmax'
,
'scatter_softmax'
,
'scatter_log_softmax'
,
'scatter_log_softmax'
,
'torch_scatter'
,
'torch_scatter'
,
'cuda_version'
,
'__version__'
,
'__version__'
,
]
]
torch_scatter/scatter.py
View file @
cd156a4e
import
importlib
import
os.path
as
osp
import
os.path
as
osp
from
typing
import
Optional
,
Tuple
from
typing
import
Optional
,
Tuple
...
@@ -5,8 +6,8 @@ import torch
...
@@ -5,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
(
osp
.
join
(
osp
.
dirname
(
osp
.
abspath
(
__file__
)),
'_scatter.so'
)
)
'_scatter'
,
[
osp
.
dirname
(
__file__
)]).
origin
)
@
torch
.
jit
.
script
@
torch
.
jit
.
script
...
...
torch_scatter/segment_coo.py
View file @
cd156a4e
import
importlib
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
(
osp
.
join
(
osp
.
dirname
(
osp
.
abspath
(
__file__
)),
'_segment_coo.so'
)
)
'_segment_coo'
,
[
osp
.
dirname
(
__file__
)]).
origin
)
@
torch
.
jit
.
script
@
torch
.
jit
.
script
...
...
torch_scatter/segment_csr.py
View file @
cd156a4e
import
importlib
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
(
osp
.
join
(
osp
.
dirname
(
osp
.
abspath
(
__file__
)),
'_segment_csr.so'
)
)
'_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