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
1488dee0
Commit
1488dee0
authored
Feb 11, 2020
by
rusty1s
Browse files
torch version check
parent
75a0b265
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
17 deletions
+29
-17
.travis.yml
.travis.yml
+12
-13
script/install.sh
script/install.sh
+1
-0
torch_scatter/__init__.py
torch_scatter/__init__.py
+16
-4
No files found.
.travis.yml
View file @
1488dee0
...
...
@@ -67,17 +67,17 @@ jobs:
before_install
:
-
choco install python --version 3.7.6
-
python -m pip install --upgrade --user pip
#
- name: windows/cu92
#
os: windows
#
language: shell
#
env:
#
-
FORCE_CUDA=1
#
- CUDA_SHORT=9.2
#
- CUDA=9.2.148
#
- TORCH=${TORCH_VERSION}+
92
#
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
#
before_install:
#
- choco install python --version 3.7.6
-
name
:
windows/cu92
os
:
windows
language
:
shell
env
:
-
IDX=cu92
-
CUDA_SHORT=9.2
-
CUDA=9.2.148
-
TORCH=${TORCH_VERSION}+
${IDX}
-
PATH=/c/Python37:/c/Python37/Scripts:$PATH
before_install
:
-
choco install python --version 3.7.6
# - name: windows/cu100
# os: windows
# language: shell
...
...
@@ -115,8 +115,7 @@ script:
-
flake8 .
-
python3 setup.py test || python setup.py test
after_success
:
-
if [ "${TRAVIS_OS_NAME}" != "windows" ]; then python3 setup.py bdist_wheel --dist-dir=dist/${IDX}; fi
-
if [ "${TRAVIS_OS_NAME}" = "windows" ]; then python setup.py bdist_wheel --dist-dir=dist/${IDX}; fi
python3 setup.py bdist_wheel --dist-dir=dist/${IDX} || python setup.py bdist_wheel --dist-dir=dist/${IDX}
- codecov
deploy
:
provider
:
s3
...
...
script/install.sh
View file @
1488dee0
...
...
@@ -17,5 +17,6 @@ fi
if
[
"
${
TRAVIS_OS_NAME
}
"
=
"windows"
]
&&
[
"
${
IDX
}
"
!=
"cpu"
]
;
then
wget
"https://developer.nvidia.com/compute/cuda/
${
CUDA_SHORT
}
/Prod2/local_installers2/cuda_
${
CUDA
}
_win10"
ls
# ./cuda_${CUDA}_win10.exe
fi
torch_scatter/__init__.py
View file @
1488dee0
# flake8: noqa
import
importlib
import
os.path
as
osp
import
torch
expected_torch_version
=
'1.4'
try
:
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
'_version'
,
[
osp
.
dirname
(
__file__
)]).
origin
)
except
OSError
as
e
:
major
,
minor
=
[
int
(
x
)
for
x
in
torch
.
__version__
.
split
(
'.'
)[:
2
]]
if
'undefined symbol'
in
str
(
e
)
and
major
!=
1
and
minor
!=
4
:
raise
RuntimeError
(
'Expected PyTorch version {} but found version '
'{}.{}.'
.
format
(
torch_version
,
major
,
minor
))
raise
OSError
(
e
)
cuda_version
=
torch
.
ops
.
torch_scatter
.
cuda_version
()
from
.scatter
import
(
scatter_sum
,
scatter_add
,
scatter_mean
,
scatter_min
,
scatter_max
,
scatter
)
from
.segment_csr
import
(
segment_sum_csr
,
segment_add_csr
,
segment_mean_csr
,
...
...
@@ -14,10 +30,6 @@ from .segment_coo import (segment_sum_coo, segment_add_coo, segment_mean_coo,
from
.composite
import
(
scatter_std
,
scatter_logsumexp
,
scatter_softmax
,
scatter_log_softmax
)
torch
.
ops
.
load_library
(
importlib
.
machinery
.
PathFinder
().
find_spec
(
'_version'
,
[
osp
.
dirname
(
__file__
)]).
origin
)
cuda_version
=
torch
.
ops
.
torch_scatter
.
cuda_version
()
if
cuda_version
!=
-
1
and
torch
.
version
.
cuda
is
not
None
:
# pragma: no cover
if
cuda_version
<
10000
:
major
,
minor
=
int
(
str
(
cuda_version
)[
0
]),
int
(
str
(
cuda_version
)[
2
])
...
...
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