cntk 968 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. pushd $(cd $(dirname ${0})/..; pwd) > /dev/null
  4. clean() {
  5. echo "cntk clean"
  6. rm -rf "./third_party/source/cntk"
  7. }
  8. sync() {
  9. echo "cntk sync"
  10. mkdir -p "./third_party/source/cntk/Source/CNTKv2LibraryDll/proto"
  11. curl --silent --location --output "./third_party/source/cntk/Source/CNTKv2LibraryDll/proto/CNTK.proto" "https://github.com/microsoft/CNTK/blob/master/Source/CNTKv2LibraryDll/proto/CNTK.proto?raw=true"
  12. }
  13. schema() {
  14. echo "cntk schema"
  15. [[ $(grep -U $'\x0D' ./source/cntk-proto.js) ]] && crlf=1
  16. node ./tools/protoc.js --root cntk --out ./source/cntk-proto.js ./third_party/source/cntk/Source/CNTKv2LibraryDll/proto/CNTK.proto
  17. if [[ -n ${crlf} ]]; then
  18. unix2dos --quiet --newfile ./source/cntk-proto.js ./source/cntk-proto.js
  19. fi
  20. }
  21. while [ "$#" != 0 ]; do
  22. command="$1" && shift
  23. case "${command}" in
  24. "clean") clean;;
  25. "sync") sync;;
  26. "schema") schema;;
  27. esac
  28. done