Skip to content

Commit 0214077

Browse files
authored
check_binary: Don't muddle for the rest of the checks (pytorch#453)
Signed-off-by: Eli Uriegas <[email protected]>
1 parent 6ab0b00 commit 0214077

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

check_binary.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,7 @@ if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
310310
build_example_cpp_with_incorrect_abi simple-torch-test
311311
fi
312312
else
313-
TMP_DIR=$(mktemp -d)
314-
trap 'rm -rf ${TMP_DIR}' EXIT
315-
pushd "${TMP_DIR}" # To attempt to not muddle results with local python path
313+
pushd /tmp
316314
python -c 'import torch'
317315
python -c 'from caffe2.python import core'
318316
popd
@@ -329,7 +327,9 @@ if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
329327
else
330328
if [[ "$(uname)" != 'Darwin' || "$PACKAGE_TYPE" != *wheel ]]; then
331329
echo "Checking that MKL is available"
330+
pushd /tmp
332331
python -c 'import torch; exit(0 if torch.backends.mkl.is_available() else 1)'
332+
popd
333333
fi
334334
fi
335335

@@ -351,6 +351,7 @@ if [[ "$DESIRED_CUDA" != 'cpu' ]]; then
351351
if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
352352
build_and_run_example_cpp check-torch-cuda
353353
else
354+
pushd /tmp
354355
echo "Checking that CUDA archs are setup correctly"
355356
timeout 20 python -c 'import torch; torch.randn([3,5]).cuda()'
356357

@@ -361,5 +362,6 @@ if [[ "$DESIRED_CUDA" != 'cpu' ]]; then
361362

362363
echo "Checking that CuDNN is available"
363364
python -c 'import torch; exit(0 if torch.backends.cudnn.is_available() else 1)'
365+
popd
364366
fi # if libtorch
365367
fi # if cuda

0 commit comments

Comments
 (0)