-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathmnn
More file actions
executable file
·40 lines (35 loc) · 2.1 KB
/
mnn
File metadata and controls
executable file
·40 lines (35 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
clean() {
echo "mnn clean"
rm -rf "./third_party/source/mnn"
}
sync() {
echo "mnn sync"
mkdir -p "./third_party/source/mnn/schema/default"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/CaffeOp.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/CaffeOp.fbs"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/ExtraInfo.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/ExtraInfo.fbs"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/MNN.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/MNN.fbs"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/Tensor.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/Tensor.fbs"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/TensorflowOp.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/TensorflowOp.fbs"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/TFQuantizeOp.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/TFQuantizeOp.fbs"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/Type.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/Type.fbs"
curl --silent --show-error --location --output "./third_party/source/mnn/schema/default/UserDefine.fbs" "https://github.com/alibaba/MNN/raw/master/schema/default/UserDefine.fbs"
}
schema() {
echo "mnn schema"
[[ $(grep -U $'\x0D' ./source/mnn-schema.js) ]] && crlf=1
node ./tools/flatc.js --text --root mnn --out ./source/mnn-schema.js ./third_party/source/mnn/schema/default/MNN.fbs
if [[ -n ${crlf} ]]; then
unix2dos --quiet --newfile ./source/mnn-schema.js ./source/mnn-schema.js
fi
}
while [ "$#" != 0 ]; do
command="$1" && shift
case "${command}" in
"clean") clean;;
"sync") sync;;
"schema") schema;;
esac
done