5f5a232dbff76a79d97c022e2cb10d754fdb65f1
[platform/upstream/dldt.git] / docs / nGraph_DG / build_function.md
1 # Build nGraph Function {#openvino_docs_nGraph_DG_build_function}
2
3 This section illustrates how to construct an nGraph function 
4 composed of operations from an available opset. Once created, 
5 it can wrap into a `CNNNetwork`, creating utility for data scientists 
6 or app developers to define a deep-learning model in a neutral way
7 that does not depend on existing Deep Learning (DL) frameworks.
8
9 OperationĀ SetĀ `opsetX` integrates a list of nGraph pre-compiled operations that work
10 for this purpose. In other words, `opsetX` defines a set of operations for building a graph.
11
12 For a complete list of operation sets supported by Inference Engine, see [Available Operations Sets](../ops/opset.md).
13
14 To add custom nGraph operations to an existing `CNNNetwork`, see 
15 the [Add Custom nGraph Operations](../IE_DG/Extensibility_DG/Intro.md) document.
16
17 Below you can find examples on to how build `ngraph::Function` from the `opset3` operations:
18
19 @snippet example_ngraph_utils.cpp ngraph:include
20
21 @snippet example_ngraph_utils.cpp ngraph_utils:simple_function
22
23 @snippet example_ngraph_utils.cpp ngraph_utils:advanced_function
24
25 To wrap it into a CNNNetwork, use: 
26 ```cpp
27 CNNNetwork net (ng_function);
28 ```
29 ## See Also
30
31 * [Available Operation Sets](../ops/opset.md)
32 * [Operation Set `opset1` Specification](../ops/opset1.md)
33 * [Operation Set `opset2` Specification](../ops/opset2.md)
34 * [Operation Set `opset3` Specification](../ops/opset3.md)
35 * [Operation Set `opset4` Specification](../ops/opset4.md)
36 * [Inference Engine Extensibility Developer Guide](../IE_DG/Extensibility_DG/Intro.md)