Skip to main content

# Python binding for the nGraph Library

Project description

## Build the nGraph Library (required)

Follow the [build instructions] to build nGraph. When you get to the cmake command, be sure to specify the option that enables ONNX support in the Library:

$ cmake ../ -DNGRAPH_ONNX_IMPORT_ENABLE=ON

Next, clone the pybind11 repository:

$ cd ngraph/python $ git clone –recursive https://github.com/pybind/pybind11.git

Set the environment variables:

export NGRAPH_CPP_BUILD_PATH=$HOME/ngraph_dist export LD_LIBRARY_PATH=$HOME/ngraph_dist/lib export DYLD_LIBRARY_PATH=$HOME/ngraph_dist/lib # (Only needed on MacOS) export PYBIND_HEADERS_PATH=pybind11

Install the wrapper (Python binding):

$ python setup.py install

Unit tests require additional packages be installed:

$ pip install -r test_requirements.txt

Then run a test:

$ pytest test/test_ops.py $ pytest test/ngraph/

## Running tests with tox

[Tox] is a Python [virtualenv] management and test command line tool. In our project it automates:

  • running of unit tests with [pytest]

  • checking that code style is compliant with [PEP8] using [Flake8]

  • static type checking using [MyPy]

  • testing across Python 2 and 3

Installing and running test with Tox:

$ pip install tox $ tox

You can run tests using only Python 3 or 2 using the -e (environment) switch:

$ tox -e py36 $ tox -e py27

You can check styles in a particular code directory by specifying the path:

$ tox ngraph/

If you run into any problems, try recreating the virtual environments by deleting the .tox directory:

$ rm -rf .tox $ tox

[build instructions]:http://ngraph.nervanasys.com/docs/latest/buildlb.html [Tox]:https://tox.readthedocs.io/ [virtualenv]:https://virtualenv.pypa.io/ [pytest]:https://docs.pytest.org/ [PEP8]:https://www.python.org/dev/peps/pep-0008 [Flake8]:http://flake8.pycqa.org [MyPy]:http://mypy.readthedocs.io Home-page: https://ai.intel.com/ Author: Intel Author-email: intelnervana@intel.com License: License :: OSI Approved :: Apache Software License Description: UNKNOWN Platform: UNKNOWN

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ngraph_core-0.10.1-cp35-cp35m-manylinux1_x86_64.whl (50.8 MB view hashes)

Uploaded CPython 3.5m

ngraph_core-0.10.1-cp27-cp27mu-manylinux1_x86_64.whl (50.8 MB view hashes)

Uploaded CPython 2.7mu

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page