| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #!/bin/bash
- mkdir -p ../third_party
- [email protected]:tensorflow/tensorflow.git
- if [ -d "../third_party/tensorflow" ]; then
- pushd "../third_party/tensorflow" > /dev/null
- echo "Fetch ${repository}..."
- git fetch -p
- echo "Reset ${repository}..."
- git reset --hard origin/master
- popd > /dev/null
- else
- pushd "../third_party" > /dev/null
- echo "Clone ${repository}..."
- git clone --recursive ${repository}
- popd > /dev/null
- fi
- echo "Generate '../src/tf.js'"
- ../node_modules/protobufjs/bin/pbjs -t static-module -w closure -r tf -o ../src/tf.js \
- ../third_party/tensorflow/tensorflow/core/protobuf/saved_model.proto \
- ../third_party/tensorflow/tensorflow/core/protobuf/meta_graph.proto \
- ../third_party/tensorflow/tensorflow/core/protobuf/saver.proto \
- ../third_party/tensorflow/tensorflow/core/framework/graph.proto \
- ../third_party/tensorflow/tensorflow/core/framework/op_def.proto \
- ../third_party/tensorflow/tensorflow/core/framework/tensor_shape.proto \
- ../third_party/tensorflow/tensorflow/core/framework/types.proto \
- ../third_party/tensorflow/tensorflow/core/framework/node_def.proto \
- ../third_party/tensorflow/tensorflow/core/framework/versions.proto \
- ../third_party/tensorflow/tensorflow/core/framework/function.proto \
- ../third_party/tensorflow/tensorflow/core/framework/attr_value.proto \
- ../third_party/tensorflow/tensorflow/core/framework/tensor.proto \
- ../third_party/tensorflow/tensorflow/core/framework/resource_handle.proto \
- echo "Generate '../src/tf-metadata.json'"
- protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/attr_value.proto --python_out=.
- protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/tensor.proto --python_out=.
- protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/types.proto --python_out=.
- protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/tensor_shape.proto --python_out=.
- protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/resource_handle.proto --python_out=.
- protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/api_def.proto --python_out=.
- protoc --proto_path /Users/lutzroeder/Projects/Netron/third_party/tensorflow tensorflow/core/framework/op_def.proto --python_out=.
- touch tensorflow/__init__.py
- touch tensorflow/core/__init__.py
- touch tensorflow/core/framework/__init__.py
- python tf-metadata.py
- rm -rf ./tensorflow
|