Skip to content

Commit ca3f6c7

Browse files
committed
potential windows fix
1 parent 01ab13d commit ca3f6c7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ env:
2727
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.5 IDX=cu101
2828

2929
jobs:
30-
exclude: # Exclude all macOS CUDA jobs and Windows cu100 job.
30+
exclude: # Exclude all macOS CUDA jobs and Windows CUDA 10.0 jobs.
3131
- os: osx
3232
env: TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
3333
- os: osx
@@ -63,8 +63,8 @@ jobs:
6363

6464

6565
install:
66-
- source script/cuda.sh
6766
- source script/conda.sh
67+
- source script/cuda.sh
6868
- conda create --yes -n test python=${PYTHON_VERSION}
6969
- source activate test
7070
- if [ ${TRAVIS_OS_NAME} = "windows" ] || [ $IDX != "cu92" ]; then conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch -c defaults -c numba/label/dev --yes; else conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch --yes; fi

script/cuda.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,10 @@ if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" = "cu92" ]; then
102102
sed -i.bak -e '129,141d' "${CUDA_PATH}/include/crt/host_config.h"
103103
cat -n "${CUDA_HOME}/include/crt/host_config.h"
104104
fi
105+
106+
# Fix "member may not be initialized" error on Windows: https://github.com/pytorch/pytorch/issues/27958
107+
if [ "${TRAVIS_OS_NAME}" = "windows" ] && [ "${IDX}" != "cpu" ]; then
108+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/module.h
109+
sed -i.bak -e 's/constexpr/const/g' /c/tools/miniconda3/envs/test/lib/site-packages/torch/include/torch/csrc/jit/script/argument_spec.h
110+
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
111+
fi

0 commit comments

Comments
 (0)