Browse Source

Add Google Protobuf definitions

Lutz Roeder 8 years ago
parent
commit
f7e24212a8
2 changed files with 32 additions and 4 deletions
  1. 22 0
      src/onnx.py
  2. 10 4
      tools/onnx-generate

File diff suppressed because it is too large
+ 22 - 0
src/onnx.py


+ 10 - 4
tools/onnx-generate

@@ -3,17 +3,23 @@
 mkdir -p ../third_party
 
 pushd "../third_party" > /dev/null
-sudo rm -rf onnx
-git clone --recursive [email protected]:onnx/onnx.git
+# sudo rm -rf onnx
+#git clone --recursive [email protected]:onnx/onnx.git
 popd > /dev/null
 
 pushd "../third_party/onnx" > /dev/null
-sudo python setup.py install
+# sudo python setup.py install
 popd > /dev/null
 
 echo "Generate '../src/onnx-ml.js'"
-#../node_modules/protobufjs/bin/pbjs -w commonjs -t static-module -o ../src/onnx-ml.js ../third_party/onnx/onnx/onnx-ml.proto
 ../node_modules/protobufjs/bin/pbjs -t static-module -w closure -r onnx -o ../src/onnx-ml.js ../third_party/onnx/onnx/onnx-ml.proto
 
 echo "Generate '../src/onnx-operator.json'"
 python onnx-operator-json.py
+
+echo "Generate '../src/onnx.js'"
+protoc --js_out=library=onnx:../src --proto_path ../third_party/onnx/onnx onnx-ml.proto
+
+echo "Generate '../src/onnx.py'"
+protoc --python_out=../src --proto_path ../third_party/onnx/onnx onnx-ml.proto
+mv ../src/onnx_ml_pb2.py ../src/onnx.py

Some files were not shown because too many files changed in this diff