Skip to content

Commit

Permalink
Merge pull request #4 from joyoFeng/master
Browse files Browse the repository at this point in the history
some script replace python with python3
  • Loading branch information
Xiang Xie authored Apr 21, 2020
2 parents 6cca67f + 3bc4cbc commit f7d6f6c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions compile_and_test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ function run_stage_3() {
function run_stage_4() {
echo "stage 4: build and install .whl for python"
cd ${curdir}
python setup.py build_ext
python setup.py bdist_wheel
python3 setup.py build_ext
python3 setup.py bdist_wheel

pip_cmd=pip3

if [ $USER == "root" ]; then
${pip_cmd} install dist/*.whl
else
#python setup.py build_ext install --prefix=~/.local
#python3 setup.py build_ext install --prefix=~/.local
${pip_cmd} install dist/*.whl --user
fi

Expand Down
10 changes: 5 additions & 5 deletions example/linear_regression/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function test_lr_tf() {
return
fi
echo -e "\nrun ${script_name} ..."
python ${script_name} --epochs=${epochs} --dims=${dims} >log/${name}-tf.log 2>&1
python3 ${script_name} --epochs=${epochs} --dims=${dims} >log/${name}-tf.log 2>&1
sleep 0.5
}

Expand All @@ -29,9 +29,9 @@ function test_lr_rtt() {
fi
echo -e "\nrun ${script_name} ..."
# chmod +x ${script_name}
python ${script_name} --party_id=2 --epochs=${epochs} --dims=${dims} >log/${name}-2.log 2>&1 &
python ${script_name} --party_id=1 --epochs=${epochs} --dims=${dims} >log/${name}-1.log 2>&1 &
python ${script_name} --party_id=0 --epochs=${epochs} --dims=${dims} >log/${name}-0.log 2>&1
python3 ${script_name} --party_id=2 --epochs=${epochs} --dims=${dims} >log/${name}-2.log 2>&1 &
python3 ${script_name} --party_id=1 --epochs=${epochs} --dims=${dims} >log/${name}-1.log 2>&1 &
python3 ${script_name} --party_id=0 --epochs=${epochs} --dims=${dims} >log/${name}-0.log 2>&1
sleep 0.5
}

Expand All @@ -45,7 +45,7 @@ function test_lr() {

# compare tf and rosetta
echo -e "\nrun lr_diff ..."
python lr_diff.py --sname $1 --epochs $2
python3 lr_diff.py --sname $1 --epochs $2

sleep 0.5
}
Expand Down
10 changes: 5 additions & 5 deletions example/playground/demo/diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function test_lr_tf() {
return
fi
echo -e "\nrun ${script_name} ..."
python ${script_name} --epochs=${epochs} --dims=${dims} >log/${name}-tf.log 2>&1
python3 ${script_name} --epochs=${epochs} --dims=${dims} >log/${name}-tf.log 2>&1
sleep 0.5
}

Expand All @@ -27,9 +27,9 @@ function test_lr_rtt() {
fi
echo -e "\nrun ${script_name} ..."
# chmod +x ${script_name}
python ${script_name} --party_id=2 --epochs=${epochs} --dims=${dims} >log/${name}-2.log 2>&1 &
python ${script_name} --party_id=1 --epochs=${epochs} --dims=${dims} >log/${name}-1.log 2>&1 &
python ${script_name} --party_id=0 --epochs=${epochs} --dims=${dims} >log/${name}-0.log 2>&1
python3 ${script_name} --party_id=2 --epochs=${epochs} --dims=${dims} >log/${name}-2.log 2>&1 &
python3 ${script_name} --party_id=1 --epochs=${epochs} --dims=${dims} >log/${name}-1.log 2>&1 &
python3 ${script_name} --party_id=0 --epochs=${epochs} --dims=${dims} >log/${name}-0.log 2>&1
sleep 0.5
}

Expand All @@ -43,7 +43,7 @@ function test_LR() {

# compare tf and rosetta
echo -e "\nrun lr_diff ..."
python LR_SCE_diff.py --epochs $2 --dim $3
python3 LR_SCE_diff.py --epochs $2 --dim $3

sleep 0.5
}
Expand Down
6 changes: 3 additions & 3 deletions example/playground/demo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function show_case() {
fi
echo -e "\nrun ${script_name} ..."
# chmod +x ${script_name}
python ${script_name} --party_id=2 >log/${name}-2.log 2>&1 &
python ${script_name} --party_id=1 >log/${name}-1.log 2>&1 &
python ${script_name} --party_id=0 >log/${name}-0.log 2>&1
python3 ${script_name} --party_id=2 >log/${name}-2.log 2>&1 &
python3 ${script_name} --party_id=1 >log/${name}-1.log 2>&1 &
python3 ${script_name} --party_id=0 >log/${name}-0.log 2>&1
sleep 0.5

judge $1
Expand Down
12 changes: 6 additions & 6 deletions example/tutorials/code/tutorials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function run_tf() {
return
fi
echo -e "\nrun ${script_name} ..."
python ${script_name} >log/${name}-tf.log 2>&1
python3 ${script_name} >log/${name}-tf.log 2>&1
sleep 0.5
}

Expand All @@ -25,18 +25,18 @@ function run_rtt() {
fi
echo -e "\nrun ${script_name} ..."
# chmod +x ${script_name}
python ${script_name} --party_id=2 >log/${name}-2.log 2>&1 &
python ${script_name} --party_id=1 >log/${name}-1.log 2>&1 &
python ${script_name} --party_id=0 >log/${name}-0.log 2>&1
python3 ${script_name} --party_id=2 >log/${name}-2.log 2>&1 &
python3 ${script_name} --party_id=1 >log/${name}-1.log 2>&1 &
python3 ${script_name} --party_id=0 >log/${name}-0.log 2>&1
sleep 0.5
}

function run_stat() {
# compare tf and rosetta
echo -e "\nrun model_plot ..."
python model_plot.py --sname $1
python3 model_plot.py --sname $1
echo -e "\nrun model_metrixs ..."
python model_metrixs.py --sname $1 --model $2
python3 model_metrixs.py --sname $1 --model $2

sleep 0.5
}
Expand Down

0 comments on commit f7d6f6c

Please sign in to comment.