From 024b92a970d9ca8a23bd3a04605244ded228459d Mon Sep 17 00:00:00 2001 From: edgchen1 <18449977+edgchen1@users.noreply.github.com> Date: Mon, 18 May 2020 13:36:06 -0700 Subject: [PATCH] Use path relative to script location to refer to symbolic_opset10.py from install_deps.sh. (#3975) Update install_deps.sh to use relative path from script directory to symbolic_opset10.py. This allows install_deps.sh to be called from different working directories. --- tools/ci_build/github/linux/docker/scripts/install_deps.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/linux/docker/scripts/install_deps.sh b/tools/ci_build/github/linux/docker/scripts/install_deps.sh index 528dfac0b2..58bd0dbbb0 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_deps.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_deps.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -e +set -e -x +SCRIPT_DIR="$( dirname "${BASH_SOURCE[0]}" )" while getopts p:d:x: parameter_Option do case "${parameter_Option}" @@ -114,8 +115,7 @@ elif [ $DEVICE_TYPE = "gpu" ]; then # patch pytorch onnx export opset version 10 to export nll_loss PATH_TO_SYMBOLIC10=$(${PYTHON_EXE} -c 'import torch; import os; print(os.path.join(os.path.dirname(torch.__file__), "onnx/"))') - echo "cp ../scripts/pyt_patch/symbolic_opset10.py ${PATH_TO_SYMBOLIC10}" - cp ../scripts/pyt_patch/symbolic_opset10.py ${PATH_TO_SYMBOLIC10} + cp "${SCRIPT_DIR}/pyt_patch/symbolic_opset10.py" "${PATH_TO_SYMBOLIC10}" fi if [[ $BUILD_EXTR_PAR = *--enable_training_python_frontend_e2e_tests* ]]; then ${PYTHON_EXE} -m pip install transformers