Files
openvino/docs/nGraph_DG/nGraph_basic_concepts.md
Ilya Churaev 6f0aaf2bb5 ngraph docs to master (#2568)
* First draft of nGraph documentation

* updated according to review comments

* Updated

* Reviewed the nGraph Transformation section, added missing images

* Update nGraph_dg.md

* Delete python_api.md

Removed since there is already the nGraph_Python_API.md document with a comprehensive overview.

* Fixed links to images

Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com>
Co-authored-by: CCR\avladimi <anastasiya.ageeva@intel.com>
2020-10-07 14:49:47 +03:00

2.3 KiB

nGraph Basic Concepts

The nGraph represents neural networks in uniform format. User can create different operations and combined their to one ngraph::Function.

nGraph Function and Graph Representation

nGraph function is a very simple thing: it stores shared pointers to ngraph::op::Result and ngraph::op::Parameter operations that are inputs and outputs of the graph. All other operations hold each other via shared pointers: child operation holds its parent (hard link). If operation has no consumers and it's not Result operation (shared pointer counter is zero) then it will be destructed and won't be accessible anymore. Each operation in ngraph::Function has a std::shared_ptr<ngraph::Node> type.

For details on how to build an nGraph Function, see the Build nGraph Function page.

Operations

ngraph::Op represents any abstract operations in the nGraph representation. You need to use this class to create custom operations.

Operation Sets

Operation set represents the set of some nGraph operations. nGraph::Opset is a class which provide a functionality to work with operation sets. Custom operation set should be created to support custom operation. Please read Extensibility DevGuide for more details.

Static and Partial Shapes

nGraph has two types for shape representation:

  • ngraph::Shape - Represents static (fully defined) shapes.

  • ngraph::PartialShape - Represents dynamic shapes. That means that the rank or some of dimensions are dynamic (undefined). ngraph::PartialShape can be converted to ngraph::Shape using the get_shape() method if all dimensions are static; otherwise the conversion raises an exception.

For examples, see the Dynamic Shape and Rank section in the Overview of Transformations API.

Transformation API

nGraph transformation API allows you to manipulate the graph represented by nGraph::Function. For more details, see the Overview of Transformations API section.

Pattern Matcher

For more details, see the Pattern Matching section in the Overview of Transformations API.