pytorch/caffe2/python/onnx
Yinghai Lu dbdd28207c Expose a generic shape info struct for ONNXIFI Python interface (#42421)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42421

Previously, we can only feed shape info from Python with float dtype, and batch based dim type when we do onnxifi from Python. This diff removes this limitation and uses TensorBoundShapes protobuf as a generic shape info struct. This will make the onnxifi interface in Python more flexible.

Reviewed By: ChunliF

Differential Revision: D22889781

fbshipit-source-id: 1a89f3a68c215a0409738c425b4e0d0617d58245
2020-08-03 16:10:05 -07:00
..
bin remediation of S205607 2020-07-17 17:19:47 -07:00
tests [ONNX] Bump up ONNX submodule to a82c6a7010e2e332d8f74ad5b0c726fd47c85376 (#39372) 2020-06-02 21:08:14 -07:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00
backend.py
backend_cpp_rep.py
backend_rep.py
error.py
frontend.py replace blacklist in caffe2/python/onnx/frontend.py (#41777) 2020-07-22 10:02:16 -07:00
helper.py
onnxifi.py Expose a generic shape info struct for ONNXIFI Python interface (#42421) 2020-08-03 16:10:05 -07:00
ONNXOpCoverage.md
README.md
test_onnxifi.py
workspace.py

Caffe2 implementation of Open Neural Network Exchange (ONNX)

Usage

Installation

onnx-caffe2 is installed as a part of Caffe2. Please follow the instructions to install Caffe2.

Folder Structure

  • ./: the main folder that all code lies under
    • frontend.py: translate from caffe2 model to onnx model
    • backend.py: execution engine that runs onnx on caffe2
  • tests/: test files

Testing

onnx-caffe2 uses pytest as test driver. In order to run tests, first you need to install pytest:

pip install pytest-cov

After installing pytest, do

pytest

to run tests.

Testing coverage issues/status: https://github.com/caffe2/caffe2/blob/master/caffe2/python/onnx/ONNXOpCoverage.md

Development

During development it's convenient to install caffe2 in development mode:

cd /path/to/caffe2
pip install -e caffe2/

License

MIT License