|
|
@@ -13,7 +13,7 @@ bold() {
|
|
|
}
|
|
|
|
|
|
venv() {
|
|
|
- venv_dir=./third_party/venv/tensorflow
|
|
|
+ venv_dir=./third_party/env/tensorflow
|
|
|
[ -d "${venv_dir}" ] || ${python} -m venv ${venv_dir}
|
|
|
case "${OSTYPE}" in
|
|
|
msys*) source ${venv_dir}/Scripts/activate;;
|
|
|
@@ -24,20 +24,18 @@ venv() {
|
|
|
|
|
|
clean() {
|
|
|
bold "tf clean"
|
|
|
- rm -rf "./third_party/venv/tensorflow"
|
|
|
- rm -rf "./third_party/tensorflow"
|
|
|
+ rm -rf "./third_party/env/tensorflow"
|
|
|
+ rm -rf "./third_party/src/tensorflow"
|
|
|
}
|
|
|
|
|
|
sync() {
|
|
|
bold "tf sync"
|
|
|
- mkdir -p "./third_party"
|
|
|
- if [ -d "./third_party/tensorflow" ]; then
|
|
|
- git -C "./third_party/tensorflow" pull --quiet --prune
|
|
|
- else
|
|
|
- git -C "./third_party" clone --quiet --recursive https://github.com/tensorflow/tensorflow.git
|
|
|
- fi
|
|
|
- git -C "./third_party/tensorflow" submodule sync --quiet
|
|
|
- git -C "./third_party/tensorflow" submodule update --quiet --init --recursive
|
|
|
+ [ -d "./third_party/src/tensorflow" ] || git clone --quiet --recursive https://github.com/tensorflow/tensorflow.git "./third_party/src/tensorflow"
|
|
|
+ pushd "./third_party/src/tensorflow" > /dev/null
|
|
|
+ git pull --quiet --prune
|
|
|
+ git submodule sync --quiet
|
|
|
+ git submodule update --quiet --init --recursive
|
|
|
+ popd > /dev/null
|
|
|
}
|
|
|
|
|
|
install() {
|
|
|
@@ -51,25 +49,25 @@ schema() {
|
|
|
bold "tf schema"
|
|
|
[[ $(grep -U $'\x0D' ./src/tf-proto.js) ]] && crlf=1
|
|
|
npx pbjs -t static-module -w closure --no-encode --no-delimited --no-comments --no-convert --no-verify --no-create --keep-case --decode-text -r tf -o ./src/tf-proto.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/variable.proto \
|
|
|
- ./third_party/tensorflow/tensorflow/core/framework/resource_handle.proto \
|
|
|
- ./third_party/tensorflow/tensorflow/core/protobuf/saved_object_graph.proto \
|
|
|
- ./third_party/tensorflow/tensorflow/core/protobuf/trackable_object_graph.proto \
|
|
|
- ./third_party/tensorflow/tensorflow/core/protobuf/struct.proto \
|
|
|
- ./third_party/tensorflow/tensorflow/core/protobuf/tensor_bundle.proto \
|
|
|
- ./third_party/tensorflow/tensorflow/core/framework/tensor_slice.proto
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/protobuf/saved_model.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/protobuf/meta_graph.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/protobuf/saver.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/graph.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/op_def.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/tensor_shape.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/types.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/node_def.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/versions.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/function.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/attr_value.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/tensor.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/variable.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/resource_handle.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/protobuf/saved_object_graph.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/protobuf/trackable_object_graph.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/protobuf/struct.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/protobuf/tensor_bundle.proto \
|
|
|
+ ./third_party/src/tensorflow/tensorflow/core/framework/tensor_slice.proto
|
|
|
if [[ -n ${crlf} ]]; then
|
|
|
unix2dos --quiet --newfile ./src/tf-proto.js ./src/tf-proto.js
|
|
|
fi
|
|
|
@@ -90,7 +88,7 @@ metadata() {
|
|
|
;;
|
|
|
msys*)
|
|
|
protoc_version=$(curl -s https://api.github.com/repos/protocolbuffers/protobuf/releases/latest | grep tag_name | cut -f 2 -d : | cut -f 2 -d '"' | cut -f 2 -d v)
|
|
|
- protoc_dir=$(dirname $(mktemp -u))/protobuf/v${protoc_version}
|
|
|
+ protoc_dir=./third_party/bin/protobuf/v${protoc_version}
|
|
|
if [ ! -f "${protoc_dir}/bin/protoc.exe" ]; then
|
|
|
mkdir -p "${protoc_dir}"
|
|
|
pushd "${protoc_dir}" > /dev/null
|
|
|
@@ -101,13 +99,13 @@ metadata() {
|
|
|
protoc=${protoc_dir}/bin/protoc
|
|
|
;;
|
|
|
esac
|
|
|
- ${protoc} --proto_path ./third_party/tensorflow ./third_party/tensorflow/tensorflow/core/framework/attr_value.proto --python_out=./tools
|
|
|
- ${protoc} --proto_path ./third_party/tensorflow ./third_party/tensorflow/tensorflow/core/framework/tensor.proto --python_out=./tools
|
|
|
- ${protoc} --proto_path ./third_party/tensorflow ./third_party/tensorflow/tensorflow/core/framework/types.proto --python_out=./tools
|
|
|
- ${protoc} --proto_path ./third_party/tensorflow ./third_party/tensorflow/tensorflow/core/framework/tensor_shape.proto --python_out=./tools
|
|
|
- ${protoc} --proto_path ./third_party/tensorflow ./third_party/tensorflow/tensorflow/core/framework/resource_handle.proto --python_out=./tools
|
|
|
- ${protoc} --proto_path ./third_party/tensorflow ./third_party/tensorflow/tensorflow/core/framework/api_def.proto --python_out=./tools
|
|
|
- ${protoc} --proto_path ./third_party/tensorflow ./third_party/tensorflow/tensorflow/core/framework/op_def.proto --python_out=./tools
|
|
|
+ ${protoc} --proto_path ./third_party/src/tensorflow ./third_party/src/tensorflow/tensorflow/core/framework/attr_value.proto --python_out=./tools
|
|
|
+ ${protoc} --proto_path ./third_party/src/tensorflow ./third_party/src/tensorflow/tensorflow/core/framework/tensor.proto --python_out=./tools
|
|
|
+ ${protoc} --proto_path ./third_party/src/tensorflow ./third_party/src/tensorflow/tensorflow/core/framework/types.proto --python_out=./tools
|
|
|
+ ${protoc} --proto_path ./third_party/src/tensorflow ./third_party/src/tensorflow/tensorflow/core/framework/tensor_shape.proto --python_out=./tools
|
|
|
+ ${protoc} --proto_path ./third_party/src/tensorflow ./third_party/src/tensorflow/tensorflow/core/framework/resource_handle.proto --python_out=./tools
|
|
|
+ ${protoc} --proto_path ./third_party/src/tensorflow ./third_party/src/tensorflow/tensorflow/core/framework/api_def.proto --python_out=./tools
|
|
|
+ ${protoc} --proto_path ./third_party/src/tensorflow ./third_party/src/tensorflow/tensorflow/core/framework/op_def.proto --python_out=./tools
|
|
|
touch ./tools/tensorflow/__init__.py
|
|
|
touch ./tools/tensorflow/core/__init__.py
|
|
|
touch ./tools/tensorflow/core/framework/__init__.py
|