Prechádzať zdrojové kódy

Update PaddlePaddle script

Lutz Roeder 3 mesiacov pred
rodič
commit
697c6bd468
1 zmenil súbory, kde vykonal 10 pridanie a 9 odobranie
  1. 10 9
      tools/paddle

+ 10 - 9
tools/paddle

@@ -3,26 +3,27 @@
 set -e
 pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
 
+src_dir=./third_party/source/paddle
+
 clean() {
     echo "paddle clean"
-    rm -rf "./third_party/source/paddle"
-    rm -rf "./third_party/source/paddle-lite"
+    rm -rf "${src_dir}"
 }
 
 sync() {
     echo "paddle sync"
-    mkdir -p "./third_party/source/paddle/paddle/fluid/framework"
-    curl --silent --show-error --location --output "./third_party/source/paddle/paddle/fluid/framework/framework.proto" "https://github.com/PaddlePaddle/Paddle/raw/develop/paddle/fluid/framework/framework.proto"
-    mkdir -p "./third_party/source/paddle-lite/lite/model_parser/flatbuffers"
-    curl --silent --show-error --location --output "./third_party/source/paddle-lite/lite/model_parser/flatbuffers/framework.fbs" "https://github.com/PaddlePaddle/Paddle-Lite/raw/develop/lite/model_parser/flatbuffers/framework.fbs"
-    curl --silent --show-error --location --output "./third_party/source/paddle-lite/lite/model_parser/flatbuffers/param.fbs" "https://github.com/PaddlePaddle/Paddle-Lite/raw/develop/lite/model_parser/flatbuffers/param.fbs"
+    mkdir -p "${src_dir}/paddle/paddle/fluid/framework"
+    curl --silent --show-error --location --output "${src_dir}/paddle/paddle/fluid/framework/framework.proto" "https://github.com/PaddlePaddle/Paddle/raw/develop/paddle/fluid/framework/framework.proto"
+    mkdir -p "${src_dir}/paddle-lite/lite/model_parser/flatbuffers"
+    curl --silent --show-error --location --output "${src_dir}/paddle-lite/lite/model_parser/flatbuffers/framework.fbs" "https://github.com/PaddlePaddle/Paddle-Lite/raw/develop/lite/model_parser/flatbuffers/framework.fbs"
+    curl --silent --show-error --location --output "${src_dir}/paddle-lite/lite/model_parser/flatbuffers/param.fbs" "https://github.com/PaddlePaddle/Paddle-Lite/raw/develop/lite/model_parser/flatbuffers/param.fbs"
 }
 
 schema() {
     echo "paddle schema"
     [[ $(grep -U $'\x0D' ./source/paddle-proto.js) ]] && crlf=1
-    node ./tools/protoc.js --binary --root paddle --text --out ./source/paddle-proto.js ./third_party/source/paddle/paddle/fluid/framework/framework.proto
-    node ./tools/flatc.js --text --root paddlelite --out ./source/paddle-schema.js ./third_party/source/paddle-lite/lite/model_parser/flatbuffers/param.fbs
+    node ./tools/protoc.js --binary --root paddle --text --out ./source/paddle-proto.js ${src_dir}/paddle/paddle/fluid/framework/framework.proto
+    node ./tools/flatc.js --text --root paddlelite --out ./source/paddle-schema.js ${src_dir}/paddle-lite/lite/model_parser/flatbuffers/param.fbs
     if [[ -n ${crlf} ]]; then
         unix2dos --quiet --newfile ./source/paddle-proto.js ./source/paddle-proto.js
     fi