task_pytorch_tutorial_test.sh 596 Bytes
Newer Older
Minjie Wang's avatar
Minjie Wang committed
1
2
3
#!/bin/bash
# The working directory for this script will be "tests/scripts"

Minjie Wang's avatar
Minjie Wang committed
4
TUTORIAL_ROOT="./tutorials"
5

Minjie Wang's avatar
Minjie Wang committed
6
7
8
9
10
function fail {
    echo FAIL: $@
    exit -1
}

Minjie Wang's avatar
Minjie Wang committed
11
12
13
14
15
16
export MPLBACKEND=Agg
export DGLBACKEND=pytorch
export DGL_LIBRARY_PATH=${PWD}/build
export PYTHONPATH=${PWD}/python:$PYTHONPATH
export DGL_DOWNLOAD_DIR=${PWD}

17
18
19
pushd ${TUTORIAL_ROOT} > /dev/null
# Install requirements
pip3 install -r requirements.txt || fail "installing requirements"
Minjie Wang's avatar
Minjie Wang committed
20

21
# Test
22
for f in $(find . -name "*.py" ! -name "*_mx.py")
Minjie Wang's avatar
Minjie Wang committed
23
24
25
26
do
    echo "Running tutorial ${f} ..."
    python3 $f || fail "run ${f}"
done
27
28

popd > /dev/null