From 2e7a17b367e47d34ec2e5d22c8f5c2d9c56314de Mon Sep 17 00:00:00 2001 From: Mateusz Tabaka Date: Wed, 28 Oct 2020 04:20:52 +0100 Subject: [PATCH] fix path to code snippets in Custom_ONNX_Ops.md (#2764) --- docs/IE_DG/Extensibility_DG/Custom_ONNX_Ops.md | 8 ++++---- docs/onnx_custom_op/onnx_custom_op.cpp | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/IE_DG/Extensibility_DG/Custom_ONNX_Ops.md b/docs/IE_DG/Extensibility_DG/Custom_ONNX_Ops.md index 2f42efc..47d80ba 100644 --- a/docs/IE_DG/Extensibility_DG/Custom_ONNX_Ops.md +++ b/docs/IE_DG/Extensibility_DG/Custom_ONNX_Ops.md @@ -14,10 +14,10 @@ x < 0 => f(x) = x * beta where alpha, beta are float constants. 1. Include headers: -@snippet onnx_custom_op/main.cpp onnx_custom_op:headers +@snippet onnx_custom_op/onnx_custom_op.cpp onnx_custom_op:headers 2. Register the CustomRelu operator in the ONNX importer: -@snippet onnx_custom_op/main.cpp onnx_custom_op:register_operator +@snippet onnx_custom_op/onnx_custom_op.cpp onnx_custom_op:register_operator The `register_operator` function takes four arguments: op_type, opset version, domain, and a function object. The function object is a user-defined function that takes `ngraph::onnx_import::Node` as an input and based on that, returns a graph with nGraph operations. The `ngraph::onnx_import::Node` class represents a node in ONNX model. It provides functions to fetch input node(s) (`get_ng_inputs`), fetch attribute value (`get_attribute_value`) and many more (please refer to `onnx_import/core/node.hpp` for full class declaration). @@ -25,14 +25,14 @@ New operator registration must happen before the ONNX model is read, for example Re-registering ONNX operators within the same process is supported. During registration of the existing operator, a warning is printed. The example below demonstrates an examplary model that requires previously created 'CustomRelu' operator: -@snippet onnx_custom_op/main.cpp onnx_custom_op:model +@snippet onnx_custom_op/onnx_custom_op.cpp onnx_custom_op:model For a reference on how to create a graph with nGraph operations, visit [nGraph tutorial](../nGraphTutorial.md). For a complete list of predefined nGraph operators, visit [available operations sets](../../ops/opset.md). If operator is no longer needed, it can be unregistered by calling `unregister_operator`. The function takes three arguments `op_type`, `version`, and `domain`. -@snippet onnx_custom_op/main.cpp onnx_custom_op:unregister_operator +@snippet onnx_custom_op/onnx_custom_op.cpp onnx_custom_op:unregister_operator ## Registering custom ONNX operator based on custom nGraph operations diff --git a/docs/onnx_custom_op/onnx_custom_op.cpp b/docs/onnx_custom_op/onnx_custom_op.cpp index 42ebbd5..222e454 100644 --- a/docs/onnx_custom_op/onnx_custom_op.cpp +++ b/docs/onnx_custom_op/onnx_custom_op.cpp @@ -11,8 +11,9 @@ std::string custom_relu_model() { + return //! [onnx_custom_op:model] - return R"ONNX( +R"ONNX( ir_version: 3 producer_name: "nGraph ONNX Importer" graph { -- 2.7.4