mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Summary: Since ONNX opset version >5, Reshape changed semantics to take a shape tensor as input instead of relying on `shape` attribute to decide what shape to reshape to. ONNXIFI op has been postponing this change as some of the backends such as TensorRT were not ready. Now that the backends have adopted this semantics, we can remove the legacy mode and output opset version 7 ONNX models. This change also flushes out some of the bugs and new requirement. - Converting shape info into int64 tensor - Fix a bug when we output the shape tensor in the mapped workspace instead of the original workspace Pull Request resolved: https://github.com/pytorch/pytorch/pull/10848 Reviewed By: houseroad Differential Revision: D9495121 Pulled By: yinghai fbshipit-source-id: a6f44a89274c35b33fae9a429813ebf21d9a3d1a |
||
|---|---|---|
| .. | ||
| bin | ||
| tests | ||
| __init__.py | ||
| backend.py | ||
| backend_cpp_rep.py | ||
| backend_rep.py | ||
| error.py | ||
| frontend.py | ||
| helper.py | ||
| onnxifi.py | ||
| 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/