Skip to content

Commit fd26577

Browse files
committed
fix install
1 parent 19deedf commit fd26577

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
install:
6060
- source script/cuda.sh
6161
- source script/conda.sh
62+
- conda create --yes -n test python="${PYTHON_VERSION}"
63+
- source activate test
64+
- source script/torch.sh
6265
- pip install flake8 codecov
6366
- python setup.py install
6467

script/conda.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,3 @@ fi
2424
conda update --yes conda
2525

2626
conda create --yes -n test python="${PYTHON_VERSION}"
27-
source activate test
28-
conda install pytorch="${TORCH_VERSION}" "${TOOLKIT}" -c pytorch --yes
29-
30-
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
31-
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
32-
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/module.h
33-
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/argument_spec.h
34-
sed -i.bak -e 's/return \*(this->value)/return \*((type\*)this->value)/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/pybind11/cast.h
35-
fi

script/torch.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
conda install pytorch="${TORCH_VERSION}" "${TOOLKIT}" -c pytorch --yes
4+
5+
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
6+
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
7+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/module.h
8+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/argument_spec.h
9+
sed -i.bak -e 's/return \*(this->value)/return \*((type\*)this->value)/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/pybind11/cast.h
10+
fi
11+

0 commit comments

Comments
 (0)