tf-update 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. mkdir -p ../third_party
  3. [email protected]:tensorflow/tensorflow.git
  4. if [ -d "../third_party/tensorflow" ]; then
  5. pushd "../third_party/tensorflow" > /dev/null
  6. echo "Fetch ${repository}..."
  7. git fetch -p
  8. echo "Reset ${repository}..."
  9. git reset --hard origin/master
  10. popd > /dev/null
  11. else
  12. pushd "../third_party" > /dev/null
  13. echo "Clone ${repository}..."
  14. git clone --recursive ${repository}
  15. popd > /dev/null
  16. fi
  17. echo "Generate '../src/tf.js'"
  18. ../node_modules/protobufjs/bin/pbjs -t static-module -w closure -r tf -o ../src/tf.js \
  19. ../third_party/tensorflow/tensorflow/core/protobuf/saved_model.proto \
  20. ../third_party/tensorflow/tensorflow/core/protobuf/meta_graph.proto \
  21. ../third_party/tensorflow/tensorflow/core/protobuf/saver.proto \
  22. ../third_party/tensorflow/tensorflow/core/framework/graph.proto \
  23. ../third_party/tensorflow/tensorflow/core/framework/op_def.proto \
  24. ../third_party/tensorflow/tensorflow/core/framework/tensor_shape.proto \
  25. ../third_party/tensorflow/tensorflow/core/framework/types.proto \
  26. ../third_party/tensorflow/tensorflow/core/framework/node_def.proto \
  27. ../third_party/tensorflow/tensorflow/core/framework/versions.proto \
  28. ../third_party/tensorflow/tensorflow/core/framework/function.proto \
  29. ../third_party/tensorflow/tensorflow/core/framework/attr_value.proto \
  30. ../third_party/tensorflow/tensorflow/core/framework/tensor.proto \
  31. ../third_party/tensorflow/tensorflow/core/framework/resource_handle.proto \
  32. echo "Generate '../src/tf-metadata.json'"
  33. protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/attr_value.proto --python_out=.
  34. protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/tensor.proto --python_out=.
  35. protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/types.proto --python_out=.
  36. protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/tensor_shape.proto --python_out=.
  37. protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/resource_handle.proto --python_out=.
  38. protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/api_def.proto --python_out=.
  39. protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/op_def.proto --python_out=.
  40. touch tensorflow/__init__.py
  41. touch tensorflow/core/__init__.py
  42. touch tensorflow/core/framework/__init__.py
  43. python tf-metadata.py
  44. rm -rf ./tensorflow