forked from lutzroeder/netron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmodel
executable file
·36 lines (29 loc) · 1.07 KB
/
xmodel
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
#!/bin/bash
set -e
pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
clean() {
echo "xmodel clean"
rm -rf "./third_party/source/xmodel"
}
sync() {
echo "xmodel sync"
mkdir -p ./third_party/source/xmodel/tools/Vitis-AI-Library/usefultools/src
curl --silent --location --output "./third_party/source/xmodel/tools/Vitis-AI-Library/usefultools/src/xir_graph_proto_v2.proto" "https://github.com/Xilinx/Vitis-AI/blob/master/src/Vitis-AI-Library/usefultools/src/xir_graph_proto_v2.proto?raw=true"
}
schema() {
echo "xmodel schema"
[[ $(grep -U $'\x0D' ./source/xmodel-proto.js) ]] && crlf=1
node ./tools/protoc.js --text --root xmodel --out ./source/xmodel-proto.js ./third_party/source/xmodel/tools/Vitis-AI-Library/usefultools/src/xir_graph_proto_v2.proto
rm -rf ${temp}
if [[ -n ${crlf} ]]; then
unix2dos --quiet --newfile ./source/xmodel-proto.js ./source/xmodel-proto.js
fi
}
while [ "$#" != 0 ]; do
command="$1" && shift
case "${command}" in
"clean") clean;;
"sync") sync;;
"schema") schema;;
esac
done