Firstly install ONNX which cannot be installed by pip unless protoc is available.
Then, run pip install onnx-tf
For backend, run python -m unittest discover test/backend
.
In this example, we will define and run a Relu node and print the result. This example is available as a python script at example/relu.py .
from onnx_tf.backend import run_node
from onnx import helper
node_def = helper.make_node("Relu", ["X"], ["Y"])
output = run_node(node_def, [[-0.1, 0.1]])
print(output["Y"])
The result is [ 0. 0.1]
- Install ONNX
- Run
git clone git@github.com:onnx/onnx-tensorflow.git && cd onnx-tensorflow
- Run
pip install -e .
- Development follows conventions here
- onnx_tf main source code file.
- test test files.
- Install pylint:
pip install pylint
wget -O /tmp/pylintrc https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/tools/ci_build/pylintrc
- Check format:
pylint --rcfile=/tmp/pylintrc myfile.py
http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
https://docs.python.org/2/library/unittest.html
Arpith Jacob (IBM Research)
Tian Jin (IBM Research)
Gheorghe-Teodor Bercea (IBM Research)