From 0148076ed739402676a47c4be5cb2217bb4f8cdb Mon Sep 17 00:00:00 2001 From: Maciej Smyk Date: Tue, 11 Jul 2023 10:43:54 +0200 Subject: [PATCH] [DOCS] Code block update for master (#18437) * code-block-1 * Update Convert_Model_From_Paddle.md * code-block force * fix * fix-2 * Update troubleshooting-steps.md * code-block-2 * Update README.md --- docs/Extensibility_UG/GPU_Extensibility.md | 3 +- docs/IE_PLUGIN_DG/Building.md | 6 +- .../Deep_Learning_Model_Optimizer_DevGuide.md | 18 +- .../prepare_model/Additional_Optimizations.md | 18 +- docs/MO_DG/prepare_model/FP16_Compression.md | 3 +- .../Getting_performance_numbers.md | 6 +- docs/MO_DG/prepare_model/MO_Python_API.md | 24 +- .../prepare_model/Model_Optimizer_FAQ.md | 9 +- .../Convert_Model_From_Paddle.md | 93 +-- .../Convert_Model_From_PyTorch.md | 7 +- .../Convert_Model_From_TensorFlow.md | 36 +- .../convert_model/Converting_Model.md | 15 +- .../convert_model/Cutting_Model.md | 41 +- .../kaldi_specific/Aspire_Tdnn_Model.md | 3 +- .../mxnet_specific/Convert_GluonCV_Models.md | 3 +- .../pytorch_specific/Convert_Bert_ner.md | 5 +- .../pytorch_specific/Convert_F3Net.md | 3 +- .../pytorch_specific/Convert_QuartzNet.md | 3 +- .../pytorch_specific/Convert_RCAN.md | 3 +- .../pytorch_specific/Convert_RNNT.md | 3 +- .../Convert_BERT_From_Tensorflow.md | 9 +- .../Convert_CRNN_From_Tensorflow.md | 3 +- .../Convert_GNMT_From_Tensorflow.md | 2 + .../Convert_NCF_From_Tensorflow.md | 1 + .../Convert_Object_Detection_API_Models.md | 11 +- .../Convert_Slim_Library_Models.md | 3 +- .../Convert_WideAndDeep_Family_Models.md | 3 +- .../Convert_XLNet_From_Tensorflow.md | 6 +- .../Customize_Model_Optimizer.md | 1 + ...odel_Optimizer_with_Caffe_Python_Layers.md | 1 + .../Model_Optimizer_Extractor.md | 2 + .../Model_Optimizer_Ports_Connections.md | 1 + ...del_Optimizer_Transformation_Extensions.md | 4 + .../supported_plugins/config_properties.md | 2 +- .../install_guides/installing-openvino-apt.md | 2 +- docs/install_guides/troubleshooting-steps.md | 3 +- docs/notebooks-installation.md | 4 +- ...diffusion-v2-infinite-zoom-with-output.rst | 10 + ...diffusion-v2-text-to-image-with-output.rst | 6 + docs/ops/activation/Clamp_1.md | 3 +- docs/ops/activation/Elu_1.md | 3 +- docs/ops/activation/Exp_1.md | 3 +- docs/ops/activation/GELU_2.md | 3 +- docs/ops/activation/GELU_7.md | 6 +- docs/ops/activation/HSigmoid_5.md | 3 +- docs/ops/activation/HSwish_4.md | 3 +- docs/ops/activation/HardSigmoid_1.md | 3 +- docs/ops/activation/LogSoftmax_5.md | 3 +- docs/ops/activation/Mish_4.md | 3 +- docs/ops/activation/PReLU_1.md | 9 +- docs/ops/activation/ReLU_1.md | 3 +- docs/ops/activation/Selu_1.md | 3 +- docs/ops/activation/Sigmoid_1.md | 3 +- docs/ops/activation/SoftMax_1.md | 13 +- docs/ops/activation/SoftMax_8.md | 13 +- docs/ops/activation/SoftPlus_4.md | 3 +- docs/ops/activation/SoftSign_9.md | 3 +- docs/ops/activation/Swish_4.md | 6 +- docs/ops/arithmetic/Abs_1.md | 3 +- docs/ops/arithmetic/Acos_1.md | 3 +- docs/ops/arithmetic/Acosh_3.md | 3 +- docs/ops/arithmetic/Add_1.md | 6 +- docs/ops/arithmetic/Asin_1.md | 3 +- docs/ops/arithmetic/Asinh_3.md | 3 +- docs/ops/arithmetic/Atan_1.md | 3 +- docs/ops/arithmetic/Atanh_3.md | 3 +- docs/ops/arithmetic/Ceiling_1.md | 3 +- docs/ops/arithmetic/Cos_1.md | 3 +- docs/ops/arithmetic/Cosh_1.md | 3 +- docs/ops/arithmetic/CumSum_3.md | 12 +- docs/ops/arithmetic/Divide_1.md | 6 +- docs/ops/arithmetic/Erf_1.md | 3 +- docs/ops/arithmetic/FloorMod_1.md | 6 +- docs/ops/arithmetic/Floor_1.md | 3 +- docs/ops/arithmetic/Log_1.md | 3 +- docs/ops/arithmetic/Maximum_1.md | 6 +- docs/ops/arithmetic/Minimum_1.md | 6 +- docs/ops/arithmetic/Mod_1.md | 6 +- docs/ops/arithmetic/Multiply_1.md | 6 +- docs/ops/arithmetic/Negative_1.md | 3 +- docs/ops/arithmetic/Power_1.md | 6 +- docs/ops/arithmetic/Round_5.md | 46 +- docs/ops/arithmetic/Sign_1.md | 3 +- docs/ops/arithmetic/Sin_1.md | 3 +- docs/ops/arithmetic/Sinh_1.md | 3 +- docs/ops/arithmetic/Sqrt_1.md | 9 +- docs/ops/arithmetic/SquaredDifference_1.md | 6 +- docs/ops/arithmetic/Subtract_1.md | 6 +- docs/ops/arithmetic/Tan_1.md | 9 +- docs/ops/arithmetic/Tanh_1.md | 3 +- docs/ops/comparison/Equal_1.md | 6 +- docs/ops/comparison/GreaterEqual_1.md | 6 +- docs/ops/comparison/Greater_1.md | 6 +- docs/ops/comparison/IsFinite_10.md | 6 +- docs/ops/comparison/IsInf_10.md | 3 +- docs/ops/comparison/IsNaN_10.md | 3 +- docs/ops/comparison/LessEqual_1.md | 6 +- docs/ops/comparison/Less_1.md | 6 +- docs/ops/condition/Bucketize_3.md | 3 +- docs/ops/condition/If_8.md | 3 +- docs/ops/condition/NonZero_3.md | 3 +- docs/ops/condition/Select_1.md | 3 +- docs/ops/convolution/BinaryConvolution_1.md | 3 +- .../convolution/ConvolutionBackpropData_1.md | 15 +- docs/ops/convolution/Convolution_1.md | 9 +- .../convolution/DeformableConvolution_1.md | 6 +- .../convolution/DeformableConvolution_8.md | 3 +- .../GroupConvolutionBackpropData_1.md | 9 +- docs/ops/convolution/GroupConvolution_1.md | 9 +- .../ops/detection/DeformablePSROIPooling_1.md | 6 +- docs/ops/detection/DetectionOutput_1.md | 3 +- docs/ops/detection/DetectionOutput_8.md | 3 +- .../ExperimentalDetectronDetectionOutput_6.md | 3 +- ...DetectronGenerateProposalsSingleImage_6.md | 3 +- ...perimentalDetectronPriorGridGenerator_6.md | 3 +- ...erimentalDetectronROIFeatureExtractor_6.md | 3 +- docs/ops/detection/GenerateProposals_9.md | 3 +- docs/ops/detection/PSROIPooling_1.md | 49 +- docs/ops/detection/PriorBoxClustered_1.md | 37 +- docs/ops/detection/PriorBox_1.md | 37 +- docs/ops/detection/PriorBox_8.md | 37 +- docs/ops/detection/Proposal_1.md | 15 +- docs/ops/detection/Proposal_4.md | 61 +- docs/ops/detection/ROIAlign_3.md | 55 +- docs/ops/detection/ROIAlign_9.md | 55 +- docs/ops/detection/ROIPooling_1.md | 13 +- docs/ops/detection/RegionYolo_1.md | 81 +-- docs/ops/detection/ReorgYolo_1.md | 3 +- docs/ops/generation/Eye_9.md | 15 +- docs/ops/generation/RandomUniform_8.md | 30 +- docs/ops/generation/Range_1.md | 6 +- docs/ops/generation/Range_4.md | 9 +- docs/ops/image/GridSample_9.md | 3 +- docs/ops/image/I420toBGR_8.md | 6 +- docs/ops/image/I420toRGB_8.md | 6 +- docs/ops/image/Interpolate_1.md | 3 +- docs/ops/image/Interpolate_11.md | 3 +- docs/ops/image/Interpolate_4.md | 6 +- docs/ops/image/NV12toBGR_8.md | 6 +- docs/ops/image/NV12toRGB_8.md | 6 +- docs/ops/infrastructure/Assign_3.md | 3 +- docs/ops/infrastructure/Constant_1.md | 3 +- docs/ops/infrastructure/Loop_5.md | 3 +- docs/ops/infrastructure/Parameter_1.md | 25 +- docs/ops/infrastructure/ReadValue_3.md | 3 +- docs/ops/infrastructure/Result_1.md | 3 +- docs/ops/infrastructure/TensorIterator_1.md | 6 +- docs/ops/logical/LogicalAnd_1.md | 6 +- docs/ops/logical/LogicalNot_1.md | 3 +- docs/ops/logical/LogicalOr_1.md | 6 +- docs/ops/logical/LogicalXor_1.md | 6 +- docs/ops/matrix/Einsum_7.md | 6 +- docs/ops/matrix/MatMul_1.md | 18 +- docs/ops/movement/BatchToSpace_2.md | 6 +- docs/ops/movement/Broadcast_1.md | 3 +- docs/ops/movement/Broadcast_3.md | 3 +- docs/ops/movement/Concat_1.md | 6 +- docs/ops/movement/DepthToSpace_1.md | 3 +- docs/ops/movement/ExtractImagePatches_3.md | 3 +- docs/ops/movement/GatherElements_6.md | 11 +- docs/ops/movement/GatherND_5.md | 18 +- docs/ops/movement/GatherND_8.md | 23 +- docs/ops/movement/GatherTree_1.md | 6 +- docs/ops/movement/Gather_1.md | 5 +- docs/ops/movement/Gather_7.md | 12 +- docs/ops/movement/Gather_8.md | 19 +- docs/ops/movement/Pad_1.md | 6 +- docs/ops/movement/Pad_12.md | 9 +- docs/ops/movement/ReverseSequence_1.md | 3 +- docs/ops/movement/Reverse_1.md | 3 +- docs/ops/movement/Roll_7.md | 6 +- docs/ops/movement/ScatterElementsUpdate_3.md | 3 +- docs/ops/movement/ScatterNDUpdate_3.md | 3 +- docs/ops/movement/ScatterUpdate_3.md | 6 +- docs/ops/movement/ShuffleChannels_1.md | 3 +- docs/ops/movement/Slice_8.md | 630 +++++++++--------- docs/ops/movement/SpaceToBatch_2.md | 3 +- docs/ops/movement/SpaceToDepth_1.md | 3 +- docs/ops/movement/Split_1.md | 3 +- docs/ops/movement/StridedSlice_1.md | 10 +- docs/ops/movement/Tile_1.md | 9 +- docs/ops/movement/Transpose_1.md | 6 +- docs/ops/movement/Unique_10.md | 9 +- docs/ops/movement/VariadicSplit_1.md | 6 +- .../ops/normalization/BatchNormInference_1.md | 6 +- .../ops/normalization/BatchNormInference_5.md | 6 +- docs/ops/normalization/GRN_1.md | 3 +- .../normalization/GroupNormalization_12.md | 3 +- docs/ops/normalization/LRN_1.md | 3 +- docs/ops/normalization/MVN_1.md | 6 +- docs/ops/normalization/MVN_6.md | 3 +- docs/ops/normalization/NormalizeL2_1.md | 6 +- docs/ops/pooling/AdaptiveAvgPool_8.md | 3 +- docs/ops/pooling/AdaptiveMaxPool_8.md | 3 +- docs/ops/pooling/AvgPool_1.md | 3 +- docs/ops/pooling/MaxPool_1.md | 3 +- docs/ops/pooling/MaxPool_8.md | 3 +- docs/ops/quantization/FakeQuantize_1.md | 6 +- docs/ops/reduction/ReduceL1_4.md | 12 +- docs/ops/reduction/ReduceL2_4.md | 12 +- docs/ops/reduction/ReduceLogicalAnd_1.md | 12 +- docs/ops/reduction/ReduceLogicalOr_1.md | 12 +- docs/ops/reduction/ReduceMax_1.md | 12 +- docs/ops/reduction/ReduceMean_1.md | 15 +- docs/ops/reduction/ReduceMin_1.md | 12 +- docs/ops/reduction/ReduceProd_1.md | 12 +- docs/ops/reduction/ReduceSum_1.md | 12 +- docs/ops/sequence/CTCGreedyDecoderSeqLen_6.md | 3 +- docs/ops/sequence/CTCGreedyDecoder_1.md | 3 +- docs/ops/sequence/CTCLoss_4.md | 3 +- docs/ops/sequence/GRUCell_3.md | 5 +- docs/ops/sequence/GRUSequence_5.md | 3 +- docs/ops/sequence/LSTMCell_1.md | 3 +- docs/ops/sequence/OneHot_1.md | 6 +- docs/ops/sequence/RNNCell_3.md | 63 +- docs/ops/sequence/RNNSequence_5.md | 93 +-- docs/ops/shape/Reshape_1.md | 15 +- docs/ops/shape/ShapeOf_1.md | 3 +- docs/ops/shape/ShapeOf_3.md | 3 +- docs/ops/shape/Squeeze_1.md | 6 +- docs/ops/shape/Unsqueeze_1.md | 6 +- docs/ops/signals/DFT_7.md | 18 +- docs/ops/signals/IDFT_7.md | 18 +- docs/ops/signals/IRDFT_9.md | 18 +- docs/ops/signals/RDFT_9.md | 18 +- .../sort/ExperimentalDetectronTopKROIs_6.md | 3 +- .../hello_nv12_input_classification/README.md | 2 +- samples/cpp/benchmark_app/README.md | 3 +- .../hello_nv12_input_classification/README.md | 2 +- samples/python/speech_sample/README.md | 2 +- tools/pot/docs/BestPractices.md | 9 +- tools/pot/docs/DefaultQuantizationUsage.md | 6 +- tools/pot/docs/SimplifiedMode.md | 6 +- .../quantization/accuracy_aware/README.md | 2 +- .../algorithms/quantization/default/README.md | 3 +- 235 files changed, 1609 insertions(+), 1146 deletions(-) diff --git a/docs/Extensibility_UG/GPU_Extensibility.md b/docs/Extensibility_UG/GPU_Extensibility.md index 0ef611e3fcf..dbe2c865da9 100644 --- a/docs/Extensibility_UG/GPU_Extensibility.md +++ b/docs/Extensibility_UG/GPU_Extensibility.md @@ -242,7 +242,8 @@ Example Configuration File The following code sample provides an example configuration file in XML format. For information on the configuration file structure, see the `Configuration File Format <#config-file-format>`__. -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/IE_PLUGIN_DG/Building.md b/docs/IE_PLUGIN_DG/Building.md index acb8d6e7c56..d3d49fe0631 100644 --- a/docs/IE_PLUGIN_DG/Building.md +++ b/docs/IE_PLUGIN_DG/Building.md @@ -13,7 +13,7 @@ OpenVINO Developer Package To automatically generate the OpenVINO Developer Package, run the ``cmake`` tool during a OpenVINO build: -.. code-block:: bash +.. code-block:: sh $ mkdir openvino-release-build $ cd openvino-release-build @@ -52,7 +52,7 @@ Build Plugin using OpenVINO Developer Package To build a plugin source tree using the OpenVINO Developer Package, run the commands below: -.. code-block:: bash +.. code-block:: sh $ mkdir template-plugin-release-build $ cd template-plugin-release-build @@ -76,7 +76,7 @@ To build a plugin and its tests, run the following CMake scripts: The default values of the ``ENABLE_TESTS``, ``ENABLE_FUNCTIONAL_TESTS`` options are shared via the OpenVINO Developer Package and they are the same as for the main OpenVINO build tree. You can override them during plugin build using the command below: -.. code-block:: bash +.. code-block:: sh $ cmake -DENABLE_FUNCTIONAL_TESTS=OFF -DOpenVINODeveloperPackage_DIR=../openvino-release-build ../template-plugin diff --git a/docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md b/docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md index 56357ab9933..7e028cfb343 100644 --- a/docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md +++ b/docs/MO_DG/Deep_Learning_Model_Optimizer_DevGuide.md @@ -28,7 +28,8 @@ To convert a model to OpenVINO model format (``ov.Model``), you can use the foll .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model(INPUT_MODEL) @@ -63,7 +64,8 @@ To get the full list of conversion parameters, run the following command: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model(help=True) @@ -88,7 +90,8 @@ Below is a list of separate examples for different frameworks and model conversi .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("MobileNet.pb") @@ -108,7 +111,8 @@ Below is a list of separate examples for different frameworks and model conversi .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("BERT", input_shape=[[2,30],[2,30],[2,30]]) @@ -130,7 +134,8 @@ Below is a list of separate examples for different frameworks and model conversi .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("ocr.onnx", output="probabilities") @@ -156,7 +161,8 @@ Below is a list of separate examples for different frameworks and model conversi .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("unet.pdmodel", mean_values=[123,117,104], scale=255) diff --git a/docs/MO_DG/prepare_model/Additional_Optimizations.md b/docs/MO_DG/prepare_model/Additional_Optimizations.md index 4b30daaa18b..5c1c412d7c1 100644 --- a/docs/MO_DG/prepare_model/Additional_Optimizations.md +++ b/docs/MO_DG/prepare_model/Additional_Optimizations.md @@ -36,7 +36,8 @@ For example, the following command specifies the ``NHWC`` layout for a Tensorflo .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("tf_nasnet_large.onnx", layout="nhwc") @@ -61,7 +62,8 @@ having two dimensions: batch and size of the image expressed as the ``N?`` layou .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("yolov3-tiny.onnx", layout={"input_1": "nchw", "image_shape": "n?"}) @@ -89,7 +91,8 @@ the following commands to provide data in the ``NCHW`` layout: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("tf_nasnet_large.onnx", source_layout="nhwc", target_layout="nchw") @@ -117,7 +120,8 @@ mentioned earlier, use the following commands: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("yolov3-tiny.onnx", source_layout={"input_1": "nchw", "image_shape": "n?"}, target_layout={"input_1": "nhwc"}) @@ -170,7 +174,8 @@ model and applies mean-scale normalization to the input data: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("unet.pdmodel", mean_values=[123,117,104], scale=255) @@ -213,7 +218,8 @@ model and embeds the ``reverse_input_channel`` preprocessing block into OpenVINO .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("alexnet.pb", reverse_input_channels=True) diff --git a/docs/MO_DG/prepare_model/FP16_Compression.md b/docs/MO_DG/prepare_model/FP16_Compression.md index 44a829ef501..5dbd0cfc9ff 100644 --- a/docs/MO_DG/prepare_model/FP16_Compression.md +++ b/docs/MO_DG/prepare_model/FP16_Compression.md @@ -14,7 +14,8 @@ To compress the model, use the ``compress_to_fp16=True`` option: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model(INPUT_MODEL, compress_to_fp16=False) diff --git a/docs/MO_DG/prepare_model/Getting_performance_numbers.md b/docs/MO_DG/prepare_model/Getting_performance_numbers.md index 0a744ae1670..2627618aa79 100644 --- a/docs/MO_DG/prepare_model/Getting_performance_numbers.md +++ b/docs/MO_DG/prepare_model/Getting_performance_numbers.md @@ -21,7 +21,7 @@ To test performance of your model, make sure you :doc:`prepare the model for use For example, if you use :doc:`OpenVINO's automation tools `, these two lines of code will download the resnet-50-tf and convert it to OpenVINO IR. -.. code-block:: bash +.. code-block:: sh omz_downloader --name resnet-50-tf omz_converter --name resnet-50-tf @@ -36,7 +36,7 @@ For a detailed description, see the dedicated articles: The benchmark_app includes a lot of device-specific options, but the primary usage is as simple as: -.. code-block:: bash +.. code-block:: sh benchmark_app -m -d -i @@ -47,7 +47,7 @@ performance settings that contain command-line equivalents in the Benchmark app. While these settings provide really low-level control for the optimal model performance on the *specific* device, it is recommended to always start performance evaluation with the :doc:`OpenVINO High-Level Performance Hints ` first, like so: -.. code-block:: bash +.. code-block:: sh # for throughput prioritization benchmark_app -hint tput -m -d diff --git a/docs/MO_DG/prepare_model/MO_Python_API.md b/docs/MO_DG/prepare_model/MO_Python_API.md index a1e5bd951fc..a02f721e75e 100644 --- a/docs/MO_DG/prepare_model/MO_Python_API.md +++ b/docs/MO_DG/prepare_model/MO_Python_API.md @@ -15,7 +15,8 @@ Model conversion API is represented by ``convert_model()`` method in openvino.to Example of converting a PyTorch model directly from memory: -.. code-block:: python +.. code-block:: py + :force: import torchvision @@ -31,7 +32,8 @@ The following types are supported as an input model for ``convert_model()``: Example of using native Python classes to set ``input_shape``, ``mean_values`` and ``layout``: -.. code-block:: python +.. code-block:: py + :force: from openvino.runtime import PartialShape, Layout @@ -39,7 +41,8 @@ Example of using native Python classes to set ``input_shape``, ``mean_values`` a Example of using strings for setting ``input_shape``, ``mean_values`` and ``layout``: -.. code-block:: python +.. code-block:: py + :force: ov_model = convert_model(model, input_shape="[1,3,100,100]", mean_values="[127,127,127]", layout="NCHW") @@ -49,7 +52,8 @@ The shape can be a ``list`` or ``tuple`` of dimensions (``int`` or ``openvino.ru Example of using a tuple in the ``input`` parameter to cut a model: -.. code-block:: python +.. code-block:: py + :force: ov_model = convert_model(model, input=("input_name", [3], np.float32)) @@ -66,7 +70,8 @@ Supported types for ``InputCutInfo``: Example of using ``InputCutInfo`` to freeze an input with value: -.. code-block:: python +.. code-block:: py + :force: from openvino.tools.mo import convert_model, InputCutInfo @@ -85,7 +90,8 @@ Parameters supporting ``list``: Example of using lists to set shapes, types and layout for multiple inputs: -.. code-block:: python +.. code-block:: py + :force: ov_model = convert_model(model, input=[("input1", [1,3,100,100], np.float32), ("input2", [1,3,100,100], np.float32)], layout=[Layout("NCHW"), LayoutMap("NCHW", "NHWC")]) @@ -93,7 +99,8 @@ Example of using lists to set shapes, types and layout for multiple inputs: Example of using the ``Layout`` class to set the layout of a model input: -.. code-block:: python +.. code-block:: py + :force: from openvino.runtime import Layout from openvino.tools.mo import convert_model @@ -106,7 +113,8 @@ To set both source and destination layouts in the ``layout`` parameter, use the Example of using the ``LayoutMap`` class to change the layout of a model input: -.. code-block:: python +.. code-block:: py + :force: from openvino.tools.mo import convert_model, LayoutMap diff --git a/docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md b/docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md index 83cb39093b0..6b30ddbfdbe 100644 --- a/docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md +++ b/docs/MO_DG/prepare_model/Model_Optimizer_FAQ.md @@ -769,7 +769,8 @@ The name should be the compilation of the layer name with the module name separa For example, your topology contains this layer with type ``Python``: -.. code-block:: +.. code-block:: py + :force: layer { name: 'proposal' @@ -785,7 +786,8 @@ For example, your topology contains this layer with type ``Python``: The first step is to implement an extension for this layer in Model Optimizer as an ancestor of ``Op`` class: -.. code-block:: +.. code-block:: py + :force: class ProposalPythonExampleOp(Op): op = 'Proposal' @@ -796,7 +798,8 @@ The first step is to implement an extension for this layer in Model Optimizer as It is mandatory to call two functions right after the implementation of that class: -.. code-block:: +.. code-block:: py + :force: class ProposalPythonExampleOp(Op): ... diff --git a/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md b/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md index 7221572022a..e03d2ca4716 100644 --- a/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md +++ b/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_Paddle.md @@ -44,24 +44,25 @@ Converting certain PaddlePaddle models may require setting ``example_input`` or * Example of converting ``paddle.hapi.model.Model`` format model: - .. code-block:: python + .. code-block:: py + :force: - import paddle - from openvino.tools.mo import convert_model - - # create a paddle.hapi.model.Model format model - resnet50 = paddle.vision.models.resnet50() - x = paddle.static.InputSpec([1,3,224,224], 'float32', 'x') - y = paddle.static.InputSpec([1,1000], 'float32', 'y') - - model = paddle.Model(resnet50, x, y) - - # convert to OpenVINO IR format - ov_model = convert_model(model) - - # optional: serialize OpenVINO IR to *.xml & *.bin - from openvino.runtime import serialize - serialize(ov_model, "ov_model.xml", "ov_model.bin") + import paddle + from openvino.tools.mo import convert_model + + # create a paddle.hapi.model.Model format model + resnet50 = paddle.vision.models.resnet50() + x = paddle.static.InputSpec([1,3,224,224], 'float32', 'x') + y = paddle.static.InputSpec([1,1000], 'float32', 'y') + + model = paddle.Model(resnet50, x, y) + + # convert to OpenVINO IR format + ov_model = convert_model(model) + + # optional: serialize OpenVINO IR to *.xml & *.bin + from openvino.runtime import serialize + serialize(ov_model, "ov_model.xml", "ov_model.bin") * Example of converting ``paddle.fluid.dygraph.layers.Layer`` format model: @@ -69,17 +70,18 @@ Converting certain PaddlePaddle models may require setting ``example_input`` or ``list`` with tensor(``paddle.Tensor``) or InputSpec(``paddle.static.input.InputSpec``) - .. code-block:: python + .. code-block:: py + :force: - import paddle - from openvino.tools.mo import convert_model - - # create a paddle.fluid.dygraph.layers.Layer format model - model = paddle.vision.models.resnet50() - x = paddle.rand([1,3,224,224]) - - # convert to OpenVINO IR format - ov_model = convert_model(model, example_input=[x]) + import paddle + from openvino.tools.mo import convert_model + + # create a paddle.fluid.dygraph.layers.Layer format model + model = paddle.vision.models.resnet50() + x = paddle.rand([1,3,224,224]) + + # convert to OpenVINO IR format + ov_model = convert_model(model, example_input=[x]) * Example of converting ``paddle.fluid.executor.Executor`` format model: @@ -87,25 +89,26 @@ Converting certain PaddlePaddle models may require setting ``example_input`` or ``list`` or ``tuple`` with variable(``paddle.static.data``) - .. code-block:: python + .. code-block:: py + :force: - import paddle - from openvino.tools.mo import convert_model - - paddle.enable_static() - - # create a paddle.fluid.executor.Executor format model - x = paddle.static.data(name="x", shape=[1,3,224]) - y = paddle.static.data(name="y", shape=[1,3,224]) - relu = paddle.nn.ReLU() - sigmoid = paddle.nn.Sigmoid() - y = sigmoid(relu(x)) - - exe = paddle.static.Executor(paddle.CPUPlace()) - exe.run(paddle.static.default_startup_program()) - - # convert to OpenVINO IR format - ov_model = convert_model(exe, example_input=[x], example_output=[y]) + import paddle + from openvino.tools.mo import convert_model + + paddle.enable_static() + + # create a paddle.fluid.executor.Executor format model + x = paddle.static.data(name="x", shape=[1,3,224]) + y = paddle.static.data(name="y", shape=[1,3,224]) + relu = paddle.nn.ReLU() + sigmoid = paddle.nn.Sigmoid() + y = sigmoid(relu(x)) + + exe = paddle.static.Executor(paddle.CPUPlace()) + exe.run(paddle.static.default_startup_program()) + + # convert to OpenVINO IR format + ov_model = convert_model(exe, example_input=[x], example_output=[y]) Supported PaddlePaddle Layers ############################# diff --git a/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_PyTorch.md b/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_PyTorch.md index ad59e8f3cc2..37071895bef 100644 --- a/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_PyTorch.md +++ b/docs/MO_DG/prepare_model/convert_model/Convert_Model_From_PyTorch.md @@ -15,7 +15,8 @@ Model Optimizer Python API allows the conversion of PyTorch models using the ``c Example of PyTorch model conversion: -.. code-block:: python +.. code-block:: py + :force: import torchvision import torch @@ -37,7 +38,8 @@ Converting certain PyTorch models may require model tracing, which needs ``input Example of using ``example_input``: -.. code-block:: python +.. code-block:: py + :force: import torchvision import torch @@ -70,6 +72,7 @@ For more information, refer to the `Exporting PyTorch models to ONNX format @@ -92,6 +94,7 @@ The ``-b`` option is used here for conversion to override a possible undefined b The last layer in the model is ``InceptionV1/Logits/Predictions/Reshape_1``, which matches an output operation in the TensorFlow graph: .. code-block:: xml + :force: @@ -117,7 +120,8 @@ Due to automatic identification of inputs and outputs, providing the ``input`` a .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1) @@ -156,7 +160,8 @@ If you want to cut your model at the end, you have the following options: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1, output="InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu") @@ -172,6 +177,7 @@ If you want to cut your model at the end, you have the following options: The resulting Intermediate Representation has three layers: .. code-block:: xml + :force: @@ -219,7 +225,8 @@ If you want to cut your model at the end, you have the following options: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1, output="InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu:0") @@ -235,6 +242,7 @@ If you want to cut your model at the end, you have the following options: The resulting Intermediate Representation has three layers, which are the same as in the previous case: .. code-block:: xml + :force: @@ -282,7 +290,8 @@ If you want to cut your model at the end, you have the following options: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1, output="0:InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu") @@ -298,6 +307,7 @@ If you want to cut your model at the end, you have the following options: The resulting Intermediate Representation has two layers, which are the same as the first two layers in the previous case: .. code-block:: xml + :force: @@ -339,7 +349,8 @@ If you want to go further and cut the beginning of the model, leaving only the ` .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1, output="InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu", input="InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu") @@ -355,6 +366,7 @@ If you want to go further and cut the beginning of the model, leaving only the ` The resulting Intermediate Representation looks as follows: .. code-block:: xml + :force: @@ -390,7 +402,8 @@ If you want to go further and cut the beginning of the model, leaving only the ` .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1, input="0:InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu", output="InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu") @@ -406,6 +419,7 @@ If you want to go further and cut the beginning of the model, leaving only the ` The resulting Intermediate Representation looks as follows: .. code-block:: xml + :force: @@ -441,7 +455,8 @@ If you want to go further and cut the beginning of the model, leaving only the ` .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1, input="InceptionV1/InceptionV1/Conv2d_1a_7x7/BatchNorm/batchnorm/add_1:0", output="InceptionV1/InceptionV1/Conv2d_1a_7x7/Relu") @@ -457,6 +472,7 @@ If you want to go further and cut the beginning of the model, leaving only the ` The resulting Intermediate Representation looks as follows: .. code-block:: xml + :force: @@ -496,7 +512,8 @@ Following this behavior, ``convert_model()`` creates an ``Input`` layer for port .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", batch=1, input="InceptionV1/InceptionV1/Conv2d_1a_7x7/convolution") @@ -518,7 +535,8 @@ Different behavior occurs when ``input_shape`` is also used as an attempt to ove .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", input="InceptionV1/InceptionV1/Conv2d_1a_7x7/convolution", input_shape=[1,224,224,3]) @@ -548,7 +566,8 @@ The correct command line is: .. tab-item:: Python :sync: py - .. code-block:: python + .. code-block:: py + :force: from openvino.tools.mo import convert_model ov_model = convert_model("inception_v1.pb", input="0:InceptionV1/InceptionV1/Conv2d_1a_7x7/convolution", input_shape=[1,224,224,3]) diff --git a/docs/MO_DG/prepare_model/convert_model/kaldi_specific/Aspire_Tdnn_Model.md b/docs/MO_DG/prepare_model/convert_model/kaldi_specific/Aspire_Tdnn_Model.md index c5002f9a62d..856bd580cd2 100644 --- a/docs/MO_DG/prepare_model/convert_model/kaldi_specific/Aspire_Tdnn_Model.md +++ b/docs/MO_DG/prepare_model/convert_model/kaldi_specific/Aspire_Tdnn_Model.md @@ -107,7 +107,8 @@ Prepare ivectors for the Speech Recognition sample: 5. For the Speech Recognition sample, the ``.ark`` file must contain an ivector for each frame. Copy the ivector ``frame_count`` times by running the below script in the Python command prompt: - .. code-block:: python + .. code-block:: py + :force: import subprocess diff --git a/docs/MO_DG/prepare_model/convert_model/mxnet_specific/Convert_GluonCV_Models.md b/docs/MO_DG/prepare_model/convert_model/mxnet_specific/Convert_GluonCV_Models.md index 124bb40861c..37ca88d9b56 100644 --- a/docs/MO_DG/prepare_model/convert_model/mxnet_specific/Convert_GluonCV_Models.md +++ b/docs/MO_DG/prepare_model/convert_model/mxnet_specific/Convert_GluonCV_Models.md @@ -15,7 +15,8 @@ This article provides the instructions and examples on how to convert `GluonCV S 1. Choose the topology available from the `GluonCV Model Zoo `__ and export to the MXNet format using the GluonCV API. For example, for the ``ssd_512_mobilenet1.0`` topology: - .. code-block:: python + .. code-block:: py + :force: from gluoncv import model_zoo, data, utils from gluoncv.utils import export_block diff --git a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_Bert_ner.md b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_Bert_ner.md index 5b49a90def8..a4826860993 100644 --- a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_Bert_ner.md +++ b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_Bert_ner.md @@ -22,7 +22,8 @@ directory of the model repository. If you download the pretrained model, you nee to download `bert.py `__ to run the script. The instructions were tested with the commit-SHA: ``e5be564156f194f1becb0d82aeaf6e762d9eb9ed``. -.. code-block:: python +.. code-block:: py + :force: import torch @@ -61,7 +62,7 @@ The script generates ONNX model file ``bert-ner.onnx``. Converting an ONNX BERT-NER model to IR ####################################### -.. code-block:: bash +.. code-block:: sh mo --input_model bert-ner.onnx --input "input_mask[1,128],segment_ids[1,128],input_ids[1,128]" diff --git a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_F3Net.md b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_F3Net.md index 934eca8652a..04ed98ee60f 100644 --- a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_F3Net.md +++ b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_F3Net.md @@ -25,7 +25,8 @@ Downloading and Converting the Model to ONNX To download the pretrained model or train the model yourself, refer to the `instructions `__ in the F3Net model repository. First, convert the model to ONNX format. Create and run the following Python script in the ``src`` directory of the model repository: -.. code-block:: python +.. code-block:: py + :force: import torch from dataset import Config diff --git a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_QuartzNet.md b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_QuartzNet.md index 9276f3fe8ba..08d12669443 100644 --- a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_QuartzNet.md +++ b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_QuartzNet.md @@ -19,7 +19,8 @@ Here are the instructions on how to obtain QuartzNet in ONNX format. 2. Run the following code: - .. code-block:: python + .. code-block:: py + :force: import nemo import nemo.collections.asr as nemo_asr diff --git a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RCAN.md b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RCAN.md index f736befd64e..154b8d0f037 100644 --- a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RCAN.md +++ b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RCAN.md @@ -15,7 +15,8 @@ Downloading and Converting the Model to ONNX To download the pre-trained model or train the model yourself, refer to the `instruction `__ in the RCAN model repository. First, convert the model to ONNX format. Create and run the script with the following content in the root directory of the model repository: -.. code-block:: python +.. code-block:: py + :force: from argparse import Namespace diff --git a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RNNT.md b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RNNT.md index a8d11b7338c..08d14dfb1fc 100644 --- a/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RNNT.md +++ b/docs/MO_DG/prepare_model/convert_model/pytorch_specific/Convert_RNNT.md @@ -56,7 +56,8 @@ if you were following the `guide `__ file defines the pre-processing function for the Inception models. The ``preprocess_for_eval`` function contains the following code: -.. code-block:: python +.. code-block:: py + :force: ... import tensorflow as tf diff --git a/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_WideAndDeep_Family_Models.md b/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_WideAndDeep_Family_Models.md index 017a3019394..425038bca4c 100644 --- a/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_WideAndDeep_Family_Models.md +++ b/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_WideAndDeep_Family_Models.md @@ -49,7 +49,8 @@ The Wide and Deep model is no longer in the master branch of the repository but As the OpenVINO™ toolkit does not support the categorical with hash and crossed features, such feature types must be switched off in the model by changing the ``build_model_columns()`` function in `census_dataset.py` as follows: -.. code-block:: python +.. code-block:: py + :force: def build_model_columns(): """Builds a set of wide and deep feature columns.""" diff --git a/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_XLNet_From_Tensorflow.md b/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_XLNet_From_Tensorflow.md index cb0be7d770a..b9ede8f74bb 100644 --- a/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_XLNet_From_Tensorflow.md +++ b/docs/MO_DG/prepare_model/convert_model/tf_specific/Convert_XLNet_From_Tensorflow.md @@ -48,7 +48,8 @@ To get pb-file from the archive contents, you need to do the following. .. note:: The original model repository has been tested with TensorFlow 1.13.1 under Python2. - .. code-block:: python + .. code-block:: py + :force: from collections import namedtuple @@ -131,7 +132,8 @@ To get ``pb-file`` from the archive contents, follow the instructions below: 2. Save and run the following Python script in ``~/XLNet-Large/xlnet``: - .. code-block:: python + .. code-block:: py + :force: from collections import namedtuple diff --git a/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md b/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md index d2f86b2e607..b96c23beed1 100644 --- a/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md +++ b/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md @@ -225,6 +225,7 @@ example of the shape infer function for the :doc:`Reshape `__. .. code-block:: py + :force: import inspect from typing import List, Optional, Union, Dict @@ -942,6 +945,7 @@ Configure Inference Pipeline First, you should create instances of OpenVINO Model. .. code-block:: py + :force: from openvino.runtime import Core core = Core() @@ -954,6 +958,7 @@ Model tokenizer and scheduler are also important parts of the pipeline. Let us define them and put all components together. .. code-block:: py + :force: from transformers import CLIPTokenizer @@ -979,6 +984,7 @@ Consider increasing ``steps`` to get more precise results. A suggested value is ``50``, but it will take longer time to process. .. code-block:: py + :force: import gradio as gr from socket import gethostbyname, gethostname diff --git a/docs/ops/activation/Clamp_1.md b/docs/ops/activation/Clamp_1.md index 371a2619138..3135dcc11cf 100644 --- a/docs/ops/activation/Clamp_1.md +++ b/docs/ops/activation/Clamp_1.md @@ -57,7 +57,8 @@ Let *min_value* and *max_value* be *min* and *max*, respectively. The mathematic **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/Elu_1.md b/docs/ops/activation/Elu_1.md index 7998368ceea..36382d5bd23 100644 --- a/docs/ops/activation/Elu_1.md +++ b/docs/ops/activation/Elu_1.md @@ -52,7 +52,8 @@ where α corresponds to *alpha* attribute. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/Exp_1.md b/docs/ops/activation/Exp_1.md index fe11978bbbc..57967b221fe 100644 --- a/docs/ops/activation/Exp_1.md +++ b/docs/ops/activation/Exp_1.md @@ -36,7 +36,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/GELU_2.md b/docs/ops/activation/GELU_2.md index b3eb3daa0d8..5223d91f9e6 100644 --- a/docs/ops/activation/GELU_2.md +++ b/docs/ops/activation/GELU_2.md @@ -47,7 +47,8 @@ Additionally, the *Gelu* function may be approximated as follows: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/GELU_7.md b/docs/ops/activation/GELU_7.md index e69c1de5b0b..aedb55fbfba 100644 --- a/docs/ops/activation/GELU_7.md +++ b/docs/ops/activation/GELU_7.md @@ -69,7 +69,8 @@ For ``tanh`` approximation mode, *Gelu* function is represented as: *Example*: ``tanh`` approximation mode -.. code-block:: cpp +.. code-block:: xml + :force: @@ -90,7 +91,8 @@ For ``tanh`` approximation mode, *Gelu* function is represented as: *Example:* ``erf`` approximation mode -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/HSigmoid_5.md b/docs/ops/activation/HSigmoid_5.md index 2fb93070dfe..6e5f2264315 100644 --- a/docs/ops/activation/HSigmoid_5.md +++ b/docs/ops/activation/HSigmoid_5.md @@ -38,7 +38,8 @@ The HSigmoid operation is introduced in the following `article diff --git a/docs/ops/activation/HSwish_4.md b/docs/ops/activation/HSwish_4.md index a1bc89897b7..74ef71ff18b 100644 --- a/docs/ops/activation/HSwish_4.md +++ b/docs/ops/activation/HSwish_4.md @@ -39,7 +39,8 @@ The HSwish operation is introduced in the following `article diff --git a/docs/ops/activation/HardSigmoid_1.md b/docs/ops/activation/HardSigmoid_1.md index 7f5ef3b8e67..d26bba9d2d5 100644 --- a/docs/ops/activation/HardSigmoid_1.md +++ b/docs/ops/activation/HardSigmoid_1.md @@ -44,7 +44,8 @@ where α corresponds to ``alpha`` scalar input and β corresponds to ``beta`` sc **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/LogSoftmax_5.md b/docs/ops/activation/LogSoftmax_5.md index dfaccffed86..168de9e5fe4 100644 --- a/docs/ops/activation/LogSoftmax_5.md +++ b/docs/ops/activation/LogSoftmax_5.md @@ -56,7 +56,8 @@ where :math:`C` is a size of tensor along *axis* dimension. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/Mish_4.md b/docs/ops/activation/Mish_4.md index 826a21134fa..5825b35aa99 100644 --- a/docs/ops/activation/Mish_4.md +++ b/docs/ops/activation/Mish_4.md @@ -39,7 +39,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/PReLU_1.md b/docs/ops/activation/PReLU_1.md index 4271ac94d78..77535422977 100644 --- a/docs/ops/activation/PReLU_1.md +++ b/docs/ops/activation/PReLU_1.md @@ -54,7 +54,8 @@ Another mathematical representation that may be found in other references: Example: 1D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: @@ -75,7 +76,8 @@ Example: 1D input tensor ``data`` Example: 2D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: @@ -97,7 +99,8 @@ Example: 2D input tensor ``data`` Example: 4D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/ReLU_1.md b/docs/ops/activation/ReLU_1.md index 94e54e9ed9a..c1b4b6707ae 100644 --- a/docs/ops/activation/ReLU_1.md +++ b/docs/ops/activation/ReLU_1.md @@ -35,7 +35,8 @@ For each element from the input tensor calculates corresponding element in the o **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/Selu_1.md b/docs/ops/activation/Selu_1.md index 0f5058cad03..18f474a556d 100644 --- a/docs/ops/activation/Selu_1.md +++ b/docs/ops/activation/Selu_1.md @@ -50,7 +50,8 @@ Another mathematical representation that may be found in other references: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/Sigmoid_1.md b/docs/ops/activation/Sigmoid_1.md index f8078da39ee..370c866a735 100644 --- a/docs/ops/activation/Sigmoid_1.md +++ b/docs/ops/activation/Sigmoid_1.md @@ -35,7 +35,8 @@ For each element from the input tensor calculates corresponding element in the o **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/SoftMax_1.md b/docs/ops/activation/SoftMax_1.md index 3864d7cb179..d9cdae2a763 100644 --- a/docs/ops/activation/SoftMax_1.md +++ b/docs/ops/activation/SoftMax_1.md @@ -42,12 +42,13 @@ where :math:`C` is a size of tensor along *axis* dimension. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - ... - ... - + + + ... + ... + @endsphinxdirective diff --git a/docs/ops/activation/SoftMax_8.md b/docs/ops/activation/SoftMax_8.md index 519f549b8e6..65cb0a69b0d 100644 --- a/docs/ops/activation/SoftMax_8.md +++ b/docs/ops/activation/SoftMax_8.md @@ -42,12 +42,13 @@ where :math:`C` is a size of tensor along *axis* dimension. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - ... - ... - + + + ... + ... + @endsphinxdirective diff --git a/docs/ops/activation/SoftPlus_4.md b/docs/ops/activation/SoftPlus_4.md index e4897ee6f0e..9ace9640c91 100644 --- a/docs/ops/activation/SoftPlus_4.md +++ b/docs/ops/activation/SoftPlus_4.md @@ -53,7 +53,8 @@ For example, if *T* is ``fp32``, ``threshold`` should be ``20`` or if *T* is ``f **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/SoftSign_9.md b/docs/ops/activation/SoftSign_9.md index bf8fbaee1f1..c3433dbd75b 100644 --- a/docs/ops/activation/SoftSign_9.md +++ b/docs/ops/activation/SoftSign_9.md @@ -37,7 +37,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/activation/Swish_4.md b/docs/ops/activation/Swish_4.md index f460915b21e..96a7632ae62 100644 --- a/docs/ops/activation/Swish_4.md +++ b/docs/ops/activation/Swish_4.md @@ -44,7 +44,8 @@ where β corresponds to ``beta`` scalar input. Example: Second input ``beta`` provided -.. code-block:: cpp +.. code-block:: xml + :force: @@ -66,7 +67,8 @@ Example: Second input ``beta`` provided Example: Second input ``beta`` not provided -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Abs_1.md b/docs/ops/arithmetic/Abs_1.md index c49574fca69..9527e69200d 100644 --- a/docs/ops/arithmetic/Abs_1.md +++ b/docs/ops/arithmetic/Abs_1.md @@ -39,7 +39,8 @@ No attributes available. *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Acos_1.md b/docs/ops/arithmetic/Acos_1.md index 5e9b33c0d7a..b1db2dd758f 100644 --- a/docs/ops/arithmetic/Acos_1.md +++ b/docs/ops/arithmetic/Acos_1.md @@ -38,7 +38,8 @@ No attributes available. *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Acosh_3.md b/docs/ops/arithmetic/Acosh_3.md index c52b86f8551..0b1363810ca 100644 --- a/docs/ops/arithmetic/Acosh_3.md +++ b/docs/ops/arithmetic/Acosh_3.md @@ -34,7 +34,8 @@ **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Add_1.md b/docs/ops/arithmetic/Add_1.md index 8a57d0bd7ec..02576871b66 100644 --- a/docs/ops/arithmetic/Add_1.md +++ b/docs/ops/arithmetic/Add_1.md @@ -53,7 +53,8 @@ After broadcasting *Add* performs addition operation for the input tensors *a* a *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -77,7 +78,8 @@ After broadcasting *Add* performs addition operation for the input tensors *a* a *Example 2: broadcast* -.. code-block:: console +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Asin_1.md b/docs/ops/arithmetic/Asin_1.md index 224645366f9..f22a3d74172 100644 --- a/docs/ops/arithmetic/Asin_1.md +++ b/docs/ops/arithmetic/Asin_1.md @@ -38,7 +38,8 @@ No attributes available. *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Asinh_3.md b/docs/ops/arithmetic/Asinh_3.md index be50df73113..588130134bd 100644 --- a/docs/ops/arithmetic/Asinh_3.md +++ b/docs/ops/arithmetic/Asinh_3.md @@ -34,7 +34,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Atan_1.md b/docs/ops/arithmetic/Atan_1.md index df6be295676..baf93a85599 100644 --- a/docs/ops/arithmetic/Atan_1.md +++ b/docs/ops/arithmetic/Atan_1.md @@ -34,7 +34,8 @@ **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Atanh_3.md b/docs/ops/arithmetic/Atanh_3.md index e70fd71c2a4..39a48e2b834 100644 --- a/docs/ops/arithmetic/Atanh_3.md +++ b/docs/ops/arithmetic/Atanh_3.md @@ -49,7 +49,8 @@ Unsigned Integral type put: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Ceiling_1.md b/docs/ops/arithmetic/Ceiling_1.md index 312d5c114fa..53828ccf26d 100644 --- a/docs/ops/arithmetic/Ceiling_1.md +++ b/docs/ops/arithmetic/Ceiling_1.md @@ -36,7 +36,8 @@ *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Cos_1.md b/docs/ops/arithmetic/Cos_1.md index fb6a99147d2..d52a8c1545a 100644 --- a/docs/ops/arithmetic/Cos_1.md +++ b/docs/ops/arithmetic/Cos_1.md @@ -34,7 +34,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Cosh_1.md b/docs/ops/arithmetic/Cosh_1.md index b2e84a78452..027dac127a3 100644 --- a/docs/ops/arithmetic/Cosh_1.md +++ b/docs/ops/arithmetic/Cosh_1.md @@ -34,7 +34,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/CumSum_3.md b/docs/ops/arithmetic/CumSum_3.md index 3c8d73dbc00..13468c4a934 100644 --- a/docs/ops/arithmetic/CumSum_3.md +++ b/docs/ops/arithmetic/CumSum_3.md @@ -59,7 +59,8 @@ To perform the summation in the opposite direction of the axis, set reverse attr *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -77,7 +78,8 @@ To perform the summation in the opposite direction of the axis, set reverse attr *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -95,7 +97,8 @@ To perform the summation in the opposite direction of the axis, set reverse attr *Example 3* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -113,7 +116,8 @@ To perform the summation in the opposite direction of the axis, set reverse attr *Example 4* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Divide_1.md b/docs/ops/arithmetic/Divide_1.md index ec0cf6d52d2..4ba69064b51 100644 --- a/docs/ops/arithmetic/Divide_1.md +++ b/docs/ops/arithmetic/Divide_1.md @@ -64,7 +64,8 @@ The result of division by zero is undefined. *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -88,7 +89,8 @@ The result of division by zero is undefined. *Example 2: broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Erf_1.md b/docs/ops/arithmetic/Erf_1.md index bbd934813a1..098d5190288 100644 --- a/docs/ops/arithmetic/Erf_1.md +++ b/docs/ops/arithmetic/Erf_1.md @@ -36,7 +36,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/FloorMod_1.md b/docs/ops/arithmetic/FloorMod_1.md index dca84d6a7ac..08aaec96e56 100644 --- a/docs/ops/arithmetic/FloorMod_1.md +++ b/docs/ops/arithmetic/FloorMod_1.md @@ -54,7 +54,8 @@ Python programming language: :math:`floor(x / y) * y + floor\_mod(x, y) = x`. Th *Example 1 - no broadcasting* -.. code-block:: +.. code-block:: xml + :force: @@ -78,7 +79,8 @@ Python programming language: :math:`floor(x / y) * y + floor\_mod(x, y) = x`. Th *Example 2: numpy broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Floor_1.md b/docs/ops/arithmetic/Floor_1.md index 02b5f6b7c34..86a043681a5 100644 --- a/docs/ops/arithmetic/Floor_1.md +++ b/docs/ops/arithmetic/Floor_1.md @@ -38,7 +38,8 @@ element in the output tensor with the following formula: *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Log_1.md b/docs/ops/arithmetic/Log_1.md index f505670c6d7..6dfafbc3d2b 100644 --- a/docs/ops/arithmetic/Log_1.md +++ b/docs/ops/arithmetic/Log_1.md @@ -39,7 +39,8 @@ No attributes available. *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Maximum_1.md b/docs/ops/arithmetic/Maximum_1.md index db85ac1c7cf..905e1e41f33 100644 --- a/docs/ops/arithmetic/Maximum_1.md +++ b/docs/ops/arithmetic/Maximum_1.md @@ -53,7 +53,8 @@ After broadcasting *Maximum* does the following with the input tensors *a* and * *Example 1 - no broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -78,7 +79,8 @@ After broadcasting *Maximum* does the following with the input tensors *a* and * *Example 2: numpy broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Minimum_1.md b/docs/ops/arithmetic/Minimum_1.md index a17268837d6..906453cd4f9 100644 --- a/docs/ops/arithmetic/Minimum_1.md +++ b/docs/ops/arithmetic/Minimum_1.md @@ -51,7 +51,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 1 - no broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -76,7 +77,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 2: numpy broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Mod_1.md b/docs/ops/arithmetic/Mod_1.md index 31ca65b4ecd..937fb0148be 100644 --- a/docs/ops/arithmetic/Mod_1.md +++ b/docs/ops/arithmetic/Mod_1.md @@ -54,7 +54,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 1 - no broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -79,7 +80,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 2: numpy broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Multiply_1.md b/docs/ops/arithmetic/Multiply_1.md index b06fd4aa97c..77af023b2f5 100644 --- a/docs/ops/arithmetic/Multiply_1.md +++ b/docs/ops/arithmetic/Multiply_1.md @@ -54,7 +54,8 @@ After broadcasting *Multiply* performs multiplication operation for the input te *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -79,7 +80,8 @@ After broadcasting *Multiply* performs multiplication operation for the input te *Example 2: broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Negative_1.md b/docs/ops/arithmetic/Negative_1.md index 61ba7b73c01..761ae414c90 100644 --- a/docs/ops/arithmetic/Negative_1.md +++ b/docs/ops/arithmetic/Negative_1.md @@ -36,7 +36,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Power_1.md b/docs/ops/arithmetic/Power_1.md index 8188afd6a64..bbe918222db 100644 --- a/docs/ops/arithmetic/Power_1.md +++ b/docs/ops/arithmetic/Power_1.md @@ -50,7 +50,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 1 - no broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -75,7 +76,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 2: numpy broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Round_5.md b/docs/ops/arithmetic/Round_5.md index d11cd8f1c50..5b40a070d55 100644 --- a/docs/ops/arithmetic/Round_5.md +++ b/docs/ops/arithmetic/Round_5.md @@ -14,13 +14,14 @@ **Detailed description**: Operation takes one input tensor and rounds the values, element-wise, meaning it finds the nearest integer for each value. In case of halves, the rule is to round them to the nearest even integer if ``mode`` attribute is ``half_to_even`` or rounding in such a way that the result heads away from zero if ``mode`` attribute is ``half_away_from_zero``. -.. code-block:: cpp +.. code-block:: xml + :force: - Input = [-4.5, -1.9, -1.5, 0.5, 0.9, 1.5, 2.3, 2.5] - - round(Input, mode = `half_to_even`) = [-4.0, -2.0, -2.0, 0.0, 1.0, 2.0, 2.0, 2.0] - - round(Input, mode = `half_away_from_zero`) = [-5.0, -2.0, -2.0, 1.0, 1.0, 2.0, 2.0, 3.0] + Input = [-4.5, -1.9, -1.5, 0.5, 0.9, 1.5, 2.3, 2.5] + + round(Input, mode = `half_to_even`) = [-4.0, -2.0, -2.0, 0.0, 1.0, 2.0, 2.0, 2.0] + + round(Input, mode = `half_away_from_zero`) = [-5.0, -2.0, -2.0, 1.0, 1.0, 2.0, 2.0, 3.0] **Attributes**: @@ -46,22 +47,23 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 256 - 56 - - - - - 256 - 56 - - - + + + + + 256 + 56 + + + + + 256 + 56 + + + @endsphinxdirective diff --git a/docs/ops/arithmetic/Sign_1.md b/docs/ops/arithmetic/Sign_1.md index 38226a26405..ea361b38f5d 100644 --- a/docs/ops/arithmetic/Sign_1.md +++ b/docs/ops/arithmetic/Sign_1.md @@ -35,7 +35,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Sin_1.md b/docs/ops/arithmetic/Sin_1.md index fe9ae89402d..29649992ca0 100644 --- a/docs/ops/arithmetic/Sin_1.md +++ b/docs/ops/arithmetic/Sin_1.md @@ -42,7 +42,8 @@ No attributes available. *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Sinh_1.md b/docs/ops/arithmetic/Sinh_1.md index 07d9db6d914..6b4f4dc7def 100644 --- a/docs/ops/arithmetic/Sinh_1.md +++ b/docs/ops/arithmetic/Sinh_1.md @@ -34,7 +34,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Sqrt_1.md b/docs/ops/arithmetic/Sqrt_1.md index d2247e3e2ae..ae436eef7af 100644 --- a/docs/ops/arithmetic/Sqrt_1.md +++ b/docs/ops/arithmetic/Sqrt_1.md @@ -40,7 +40,8 @@ *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -57,7 +58,8 @@ *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -75,7 +77,8 @@ *Example 3* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/SquaredDifference_1.md b/docs/ops/arithmetic/SquaredDifference_1.md index 5744eee835f..aed874982ef 100644 --- a/docs/ops/arithmetic/SquaredDifference_1.md +++ b/docs/ops/arithmetic/SquaredDifference_1.md @@ -50,7 +50,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 1 - no broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -74,7 +75,8 @@ As a first step input tensors *a* and *b* are broadcasted if their shapes differ *Example 2: numpy broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Subtract_1.md b/docs/ops/arithmetic/Subtract_1.md index 704aa7818ad..4653f52f83e 100644 --- a/docs/ops/arithmetic/Subtract_1.md +++ b/docs/ops/arithmetic/Subtract_1.md @@ -52,7 +52,8 @@ After broadcasting *Subtract* performs subtraction operation for the input tenso *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -76,7 +77,8 @@ After broadcasting *Subtract* performs subtraction operation for the input tenso *Example 2: broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Tan_1.md b/docs/ops/arithmetic/Tan_1.md index b2f0e1aa3b9..c2958560df9 100644 --- a/docs/ops/arithmetic/Tan_1.md +++ b/docs/ops/arithmetic/Tan_1.md @@ -20,14 +20,16 @@ *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: input = [0.0, 0.25, -0.25, 0.5, -0.5] output = [0.0, 0.25534192, -0.25534192, 0.54630249, -0.54630249] *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: input = [-2, -1, 0, 1, 2] output = [2, -2, 0, 2, -2] @@ -49,7 +51,8 @@ **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/arithmetic/Tanh_1.md b/docs/ops/arithmetic/Tanh_1.md index 8c3cb77b4e8..27e9af2b7ba 100644 --- a/docs/ops/arithmetic/Tanh_1.md +++ b/docs/ops/arithmetic/Tanh_1.md @@ -41,7 +41,8 @@ For each element from the input tensor calculates corresponding element in the o *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/Equal_1.md b/docs/ops/comparison/Equal_1.md index d827d7b152b..2834c437d1a 100644 --- a/docs/ops/comparison/Equal_1.md +++ b/docs/ops/comparison/Equal_1.md @@ -53,7 +53,8 @@ After broadcasting *Equal* does the following with the input tensors *a* and *b* *Example 1: no broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -77,7 +78,8 @@ After broadcasting *Equal* does the following with the input tensors *a* and *b* *Example 2: numpy broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/GreaterEqual_1.md b/docs/ops/comparison/GreaterEqual_1.md index 250f6e8b36f..49c781f97a8 100644 --- a/docs/ops/comparison/GreaterEqual_1.md +++ b/docs/ops/comparison/GreaterEqual_1.md @@ -58,7 +58,8 @@ After broadcasting, *GreaterEqual* does the following with the input tensors *a* *Example 1: no broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -82,7 +83,8 @@ After broadcasting, *GreaterEqual* does the following with the input tensors *a* *Example 2: numpy broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/Greater_1.md b/docs/ops/comparison/Greater_1.md index 7089540794c..0c893f2218e 100644 --- a/docs/ops/comparison/Greater_1.md +++ b/docs/ops/comparison/Greater_1.md @@ -59,7 +59,8 @@ After broadcasting, *Greater* does the following with the input tensors *a* and *Example 1: no broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -84,7 +85,8 @@ After broadcasting, *Greater* does the following with the input tensors *a* and *Example 2: numpy broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/IsFinite_10.md b/docs/ops/comparison/IsFinite_10.md index 5b4eed0ac8a..70839f7a56b 100644 --- a/docs/ops/comparison/IsFinite_10.md +++ b/docs/ops/comparison/IsFinite_10.md @@ -37,7 +37,8 @@ **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -55,7 +56,8 @@ -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/IsInf_10.md b/docs/ops/comparison/IsInf_10.md index 77d148d0255..4fc824b96f8 100644 --- a/docs/ops/comparison/IsInf_10.md +++ b/docs/ops/comparison/IsInf_10.md @@ -50,7 +50,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/IsNaN_10.md b/docs/ops/comparison/IsNaN_10.md index ee2f81ee187..916c0f06540 100644 --- a/docs/ops/comparison/IsNaN_10.md +++ b/docs/ops/comparison/IsNaN_10.md @@ -35,7 +35,8 @@ For example, for the given input tensor ``[NaN, 2.1, 3.7, NaN, Inf]`` the output **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/LessEqual_1.md b/docs/ops/comparison/LessEqual_1.md index 8af844849c3..0f82a61f8d2 100644 --- a/docs/ops/comparison/LessEqual_1.md +++ b/docs/ops/comparison/LessEqual_1.md @@ -54,7 +54,8 @@ After broadcasting *LessEqual* does the following with the input tensors *a* and *Example 1: no broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -79,7 +80,8 @@ After broadcasting *LessEqual* does the following with the input tensors *a* and *Example 2: numpy broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/comparison/Less_1.md b/docs/ops/comparison/Less_1.md index 183997d6de8..169c589cefb 100644 --- a/docs/ops/comparison/Less_1.md +++ b/docs/ops/comparison/Less_1.md @@ -54,7 +54,8 @@ After broadcasting *Less* does the following with the input tensors *a* and *b*: *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -78,7 +79,8 @@ After broadcasting *Less* does the following with the input tensors *a* and *b*: *Example 2: broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/condition/Bucketize_3.md b/docs/ops/condition/Bucketize_3.md index e2015fff391..26e34a1b35a 100644 --- a/docs/ops/condition/Bucketize_3.md +++ b/docs/ops/condition/Bucketize_3.md @@ -56,7 +56,8 @@ For example, if the first input tensor is ``[[3, 50], [10, -1]]`` and the second **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/condition/If_8.md b/docs/ops/condition/If_8.md index 6a12fbdfb2e..57402cad706 100644 --- a/docs/ops/condition/If_8.md +++ b/docs/ops/condition/If_8.md @@ -92,7 +92,8 @@ Also the number of outputs from *If* always must be greater than zero and equal *Example 1: a typical If structure* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/condition/NonZero_3.md b/docs/ops/condition/NonZero_3.md index 086439f8422..c5285304109 100644 --- a/docs/ops/condition/NonZero_3.md +++ b/docs/ops/condition/NonZero_3.md @@ -46,7 +46,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/condition/Select_1.md b/docs/ops/condition/Select_1.md index 56297d08dda..8640126c39f 100644 --- a/docs/ops/condition/Select_1.md +++ b/docs/ops/condition/Select_1.md @@ -51,7 +51,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/convolution/BinaryConvolution_1.md b/docs/ops/convolution/BinaryConvolution_1.md index e248f85ce02..bbff1b2608f 100644 --- a/docs/ops/convolution/BinaryConvolution_1.md +++ b/docs/ops/convolution/BinaryConvolution_1.md @@ -103,7 +103,8 @@ Computation algorithm for mode *xnor-popcount*: 2D Convolution -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/convolution/ConvolutionBackpropData_1.md b/docs/ops/convolution/ConvolutionBackpropData_1.md index c6415372511..b7de787fa74 100644 --- a/docs/ops/convolution/ConvolutionBackpropData_1.md +++ b/docs/ops/convolution/ConvolutionBackpropData_1.md @@ -20,7 +20,8 @@ ConvolutionBackpropData accepts the same set of attributes as a regular Convolut When output shape is specified as an input tensor ``output_shape`` then it specifies only spatial dimensions. No batch or channel dimension should be passed along with spatial dimensions. If ``output_shape`` is omitted, then ``pads_begin``, ``pads_end`` or ``auto_pad`` are used to determine output spatial shape ``[O_z, O_y, O_x]`` by input spatial shape ``[I_z, I_y, I_x]`` in the following way: -.. code-block:: cpp +.. code-block:: xml + :force: if auto_pads != None: pads_begin[i] = 0 @@ -32,7 +33,8 @@ where ``K_i`` filter kernel dimension along spatial axis ``i``. If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, and ``auto_pad`` defines how to distribute padding amount around the tensor. In this case pads are determined based on the next formulas to correctly align input and output tensors: -.. code-block:: cpp +.. code-block:: xml + :force: total_padding[i] = stride[i] * (X_i - 1) + ((K_i - 1) * dilations[i] + 1) - output_shape[i] + output_padding[i] if auto_pads != SAME_UPPER: @@ -119,7 +121,8 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a *Example 1: 2D ConvolutionBackpropData* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -149,7 +152,8 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a *Example 2: 2D ConvolutionBackpropData with output_padding* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -179,7 +183,8 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a *Example 3: 2D ConvolutionBackpropData with output_shape input* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/convolution/Convolution_1.md b/docs/ops/convolution/Convolution_1.md index 2203f65e5a7..75c705998c1 100644 --- a/docs/ops/convolution/Convolution_1.md +++ b/docs/ops/convolution/Convolution_1.md @@ -113,7 +113,8 @@ The receptive field in each layer is calculated using the formulas: 1D Convolution -.. code-block:: cpp +.. code-block:: xml + :force: @@ -141,7 +142,8 @@ The receptive field in each layer is calculated using the formulas: 2D Convolution -.. code-block:: cpp +.. code-block:: xml + :force: @@ -171,7 +173,8 @@ The receptive field in each layer is calculated using the formulas: 3D Convolution -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/convolution/DeformableConvolution_1.md b/docs/ops/convolution/DeformableConvolution_1.md index 9ea23519705..23b21c06535 100644 --- a/docs/ops/convolution/DeformableConvolution_1.md +++ b/docs/ops/convolution/DeformableConvolution_1.md @@ -109,7 +109,8 @@ Where 2D DeformableConvolution (deformable_group=1) -.. code-block:: cpp +.. code-block:: xml + :force: @@ -145,7 +146,8 @@ Where 2D DeformableConvolution (deformable_group=4) -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/convolution/DeformableConvolution_8.md b/docs/ops/convolution/DeformableConvolution_8.md index b582dd02257..292561da1cd 100644 --- a/docs/ops/convolution/DeformableConvolution_8.md +++ b/docs/ops/convolution/DeformableConvolution_8.md @@ -121,7 +121,8 @@ Where 2D DeformableConvolution (deformable_group=1) -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/convolution/GroupConvolutionBackpropData_1.md b/docs/ops/convolution/GroupConvolutionBackpropData_1.md index 884ee39cef5..4d2cede8f3e 100644 --- a/docs/ops/convolution/GroupConvolutionBackpropData_1.md +++ b/docs/ops/convolution/GroupConvolutionBackpropData_1.md @@ -109,7 +109,8 @@ is derived from the kernel shape. 1D GroupConvolutionBackpropData -.. code-block:: cpp +.. code-block:: xml + :force: @@ -138,7 +139,8 @@ is derived from the kernel shape. 2D GroupConvolutionBackpropData -.. code-block:: cpp +.. code-block:: xml + :force: @@ -170,7 +172,8 @@ is derived from the kernel shape. 3D GroupConvolutionBackpropData -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/convolution/GroupConvolution_1.md b/docs/ops/convolution/GroupConvolution_1.md index 3a2024c96cb..0e48f4a7f01 100644 --- a/docs/ops/convolution/GroupConvolution_1.md +++ b/docs/ops/convolution/GroupConvolution_1.md @@ -96,7 +96,8 @@ as in regular convolution and concatenates the results. More thorough explanatio 1D GroupConvolution -.. code-block:: cpp +.. code-block:: xml + :force: @@ -124,7 +125,8 @@ as in regular convolution and concatenates the results. More thorough explanatio 2D GroupConvolution -.. code-block:: cpp +.. code-block:: xml + :force: @@ -155,7 +157,8 @@ as in regular convolution and concatenates the results. More thorough explanatio 3D GroupConvolution -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/DeformablePSROIPooling_1.md b/docs/ops/detection/DeformablePSROIPooling_1.md index e58d4b9b841..a62efaa204e 100644 --- a/docs/ops/detection/DeformablePSROIPooling_1.md +++ b/docs/ops/detection/DeformablePSROIPooling_1.md @@ -106,7 +106,8 @@ This operation is compatible with `Apache MXNet DeformablePSROIPooling @@ -135,7 +136,8 @@ This operation is compatible with `Apache MXNet DeformablePSROIPooling diff --git a/docs/ops/detection/DetectionOutput_1.md b/docs/ops/detection/DetectionOutput_1.md index 9817c6e0633..253e1e54bc3 100644 --- a/docs/ops/detection/DetectionOutput_1.md +++ b/docs/ops/detection/DetectionOutput_1.md @@ -156,7 +156,8 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/DetectionOutput_8.md b/docs/ops/detection/DetectionOutput_8.md index 891e9e0d500..5825b635fcc 100644 --- a/docs/ops/detection/DetectionOutput_8.md +++ b/docs/ops/detection/DetectionOutput_8.md @@ -154,7 +154,8 @@ At each feature map cell, *DetectionOutput* predicts the offsets relative to the **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/ExperimentalDetectronDetectionOutput_6.md b/docs/ops/detection/ExperimentalDetectronDetectionOutput_6.md index 6e0cf618c03..c7f79585860 100644 --- a/docs/ops/detection/ExperimentalDetectronDetectionOutput_6.md +++ b/docs/ops/detection/ExperimentalDetectronDetectionOutput_6.md @@ -146,7 +146,8 @@ second input: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/ExperimentalDetectronGenerateProposalsSingleImage_6.md b/docs/ops/detection/ExperimentalDetectronGenerateProposalsSingleImage_6.md index 6c5364fb743..1805b08263a 100644 --- a/docs/ops/detection/ExperimentalDetectronGenerateProposalsSingleImage_6.md +++ b/docs/ops/detection/ExperimentalDetectronGenerateProposalsSingleImage_6.md @@ -76,7 +76,8 @@ Height and width for third and fourth inputs should be equal. **Required.** **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/ExperimentalDetectronPriorGridGenerator_6.md b/docs/ops/detection/ExperimentalDetectronPriorGridGenerator_6.md index 6fd83f7e72f..55d905757e3 100644 --- a/docs/ops/detection/ExperimentalDetectronPriorGridGenerator_6.md +++ b/docs/ops/detection/ExperimentalDetectronPriorGridGenerator_6.md @@ -80,7 +80,8 @@ Numbers of generated cells is ``featmap_height`` and ``featmap_width`` if *h* an **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/ExperimentalDetectronROIFeatureExtractor_6.md b/docs/ops/detection/ExperimentalDetectronROIFeatureExtractor_6.md index 3a5440e0965..17f8cb3201c 100644 --- a/docs/ops/detection/ExperimentalDetectronROIFeatureExtractor_6.md +++ b/docs/ops/detection/ExperimentalDetectronROIFeatureExtractor_6.md @@ -82,7 +82,8 @@ For more details please see the following source: `Feature Pyramid Networks for **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/GenerateProposals_9.md b/docs/ops/detection/GenerateProposals_9.md index b2f3b7fc9b8..e138227d4a2 100644 --- a/docs/ops/detection/GenerateProposals_9.md +++ b/docs/ops/detection/GenerateProposals_9.md @@ -114,7 +114,8 @@ The ``height`` and ``width`` from inputs ``anchors``, ``boxesdeltas`` and ``scor **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/detection/PSROIPooling_1.md b/docs/ops/detection/PSROIPooling_1.md index 257316110b6..c95ae635fbc 100644 --- a/docs/ops/detection/PSROIPooling_1.md +++ b/docs/ops/detection/PSROIPooling_1.md @@ -86,31 +86,32 @@ Batch indices must be in the range of ``[0, N-1]``. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 1 - 3240 - 38 - 38 - - - 100 - 5 - - - - - 100 - 360 - 6 - 6 - - - + + + + + 1 + 3240 + 38 + 38 + + + 100 + 5 + + + + + 100 + 360 + 6 + 6 + + + @endsphinxdirective diff --git a/docs/ops/detection/PriorBoxClustered_1.md b/docs/ops/detection/PriorBoxClustered_1.md index 16ecadafc00..643cd8f6d4f 100644 --- a/docs/ops/detection/PriorBoxClustered_1.md +++ b/docs/ops/detection/PriorBoxClustered_1.md @@ -130,25 +130,26 @@ If *clip* is defined, the coordinates of prior boxes are recalculated with the f **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 2 < !-- [10, 19] --> - - - 2 < !-- [180, 320] --> - - - - - 2 - 6840 - - - + + + + + 2 < !-- [10, 19] --> + + + 2 < !-- [180, 320] --> + + + + + 2 + 6840 + + + @endsphinxdirective diff --git a/docs/ops/detection/PriorBox_1.md b/docs/ops/detection/PriorBox_1.md index f554ae24aa8..06674ebf64d 100644 --- a/docs/ops/detection/PriorBox_1.md +++ b/docs/ops/detection/PriorBox_1.md @@ -177,25 +177,26 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 2 < !-- values: [24, 42] --> - - - 2 < !-- values: [384, 672] --> - - - - - 2 - 16128 - - - + + + + + 2 < !-- values: [24, 42] --> + + + 2 < !-- values: [384, 672] --> + + + + + 2 + 16128 + + + @endsphinxdirective diff --git a/docs/ops/detection/PriorBox_8.md b/docs/ops/detection/PriorBox_8.md index c636954fc33..b8dbfa64a11 100644 --- a/docs/ops/detection/PriorBox_8.md +++ b/docs/ops/detection/PriorBox_8.md @@ -184,25 +184,26 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 2 < !-- values: [24, 42] --> - - - 2 < !-- values: [384, 672] --> - - - - - 2 - 16128 - - - + + + + + 2 < !-- values: [24, 42] --> + + + 2 < !-- values: [384, 672] --> + + + + + 2 + 16128 + + + @endsphinxdirective diff --git a/docs/ops/detection/Proposal_1.md b/docs/ops/detection/Proposal_1.md index 0c9ed9f5d25..2e3a4a5ac25 100644 --- a/docs/ops/detection/Proposal_1.md +++ b/docs/ops/detection/Proposal_1.md @@ -157,13 +157,14 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - ... - ... - + + + ... + ... + @endsphinxdirective diff --git a/docs/ops/detection/Proposal_4.md b/docs/ops/detection/Proposal_4.md index 341b6396a8e..110e09788f5 100644 --- a/docs/ops/detection/Proposal_4.md +++ b/docs/ops/detection/Proposal_4.md @@ -170,37 +170,38 @@ the second optional tensor of shape ``[batch_size * post_nms_topn]`` with probab **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 7 - 4 - 28 - 28 - - - 7 - 8 - 28 - 28 - - - 3 - - - - - 7000 - 5 - - - 7000 - - - + + + + + 7 + 4 + 28 + 28 + + + 7 + 8 + 28 + 28 + + + 3 + + + + + 7000 + 5 + + + 7000 + + + @endsphinxdirective diff --git a/docs/ops/detection/ROIAlign_3.md b/docs/ops/detection/ROIAlign_3.md index 4c33a9786a3..20c13a98aad 100644 --- a/docs/ops/detection/ROIAlign_3.md +++ b/docs/ops/detection/ROIAlign_3.md @@ -81,34 +81,35 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 7 - 256 - 200 - 200 - - - 1000 - 4 - - - 1000 - - - - - 1000 - 256 - 6 - 6 - - - + + + + + 7 + 256 + 200 + 200 + + + 1000 + 4 + + + 1000 + + + + + 1000 + 256 + 6 + 6 + + + @endsphinxdirective diff --git a/docs/ops/detection/ROIAlign_9.md b/docs/ops/detection/ROIAlign_9.md index 9f0185c2808..7f94f22df77 100644 --- a/docs/ops/detection/ROIAlign_9.md +++ b/docs/ops/detection/ROIAlign_9.md @@ -98,33 +98,34 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 7 - 256 - 200 - 200 - - - 1000 - 4 - - - 1000 - - - - - 1000 - 256 - 6 - 6 - - - + + + + + 7 + 256 + 200 + 200 + + + 1000 + 4 + + + 1000 + + + + + 1000 + 256 + 6 + 6 + + + @endsphinxdirective diff --git a/docs/ops/detection/ROIPooling_1.md b/docs/ops/detection/ROIPooling_1.md index e837a6bb124..82e783c855e 100644 --- a/docs/ops/detection/ROIPooling_1.md +++ b/docs/ops/detection/ROIPooling_1.md @@ -75,12 +75,13 @@ Batch indices must be in the range of ``[0, N-1]``. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - ... - ... - + + + ... + ... + @endsphinxdirective diff --git a/docs/ops/detection/RegionYolo_1.md b/docs/ops/detection/RegionYolo_1.md index 70d8c2ab205..ef3dd75a3fd 100644 --- a/docs/ops/detection/RegionYolo_1.md +++ b/docs/ops/detection/RegionYolo_1.md @@ -95,47 +95,48 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - < !-- YOLO V3 example --> - - - - - 1 - 255 - 26 - 26 - - - - - 1 - 255 - 26 - 26 - - - - - < !-- YOLO V2 Example --> - - - - - 1 - 125 - 13 - 13 - - - - - 1 - 21125 - - - + < !-- YOLO V3 example --> + + + + + 1 + 255 + 26 + 26 + + + + + 1 + 255 + 26 + 26 + + + + + < !-- YOLO V2 Example --> + + + + + 1 + 125 + 13 + 13 + + + + + 1 + 21125 + + + @endsphinxdirective diff --git a/docs/ops/detection/ReorgYolo_1.md b/docs/ops/detection/ReorgYolo_1.md index 4a33916d2f1..3bc092ea9e9 100644 --- a/docs/ops/detection/ReorgYolo_1.md +++ b/docs/ops/detection/ReorgYolo_1.md @@ -33,7 +33,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/generation/Eye_9.md b/docs/ops/generation/Eye_9.md index 2e6f43aad55..d07994f53c8 100644 --- a/docs/ops/generation/Eye_9.md +++ b/docs/ops/generation/Eye_9.md @@ -19,7 +19,8 @@ Example 1. *Eye* output with ``output_type`` = ``i32``: -.. code-block:: cpp +.. code-block:: xml + :force: num_rows = 3 @@ -33,7 +34,8 @@ Example 1. *Eye* output with ``output_type`` = ``i32``: Example 2. *Eye* output with ``output_type`` = ``i32``: -.. code-block:: cpp +.. code-block:: xml + :force: num_rows = 3 @@ -47,7 +49,8 @@ Example 2. *Eye* output with ``output_type`` = ``i32``: Example 3. *Eye* output with ``output_type`` = ``f16``: -.. code-block:: cpp +.. code-block:: xml + :force: num_rows = 2 @@ -90,7 +93,8 @@ Example 3. *Eye* output with ``output_type`` = ``f16``: *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -109,7 +113,8 @@ Example 3. *Eye* output with ``output_type`` = ``f16``: *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/generation/RandomUniform_8.md b/docs/ops/generation/RandomUniform_8.md index 07648fa7d3f..b4a875781bb 100644 --- a/docs/ops/generation/RandomUniform_8.md +++ b/docs/ops/generation/RandomUniform_8.md @@ -76,7 +76,8 @@ using following formula: so to obtain float16 values *sign*, *exponent* and *mantissa* are set as follows: -.. code-block:: cpp +.. code-block:: xml + :force: sign = 0 exponent = 15 - representation of a zero exponent. @@ -85,7 +86,8 @@ so to obtain float16 values *sign*, *exponent* and *mantissa* are set as follows So the resulting float16 value is: -.. code-block:: cpp +.. code-block:: xml + :force: x_uint16 = x // Truncate the upper 16 bits. val = ((exponent << 10) | x_uint16 & 0x3ffu) - 1.0, @@ -101,7 +103,8 @@ Float32 is formatted as follows: *sign* (1 bit) *exponent* (8 bits) *mantissa* ( so to obtain float values *sign*, *exponent* and *mantissa* are set as follows: -.. code-block:: cpp +.. code-block:: xml + :force: sign = 0 exponent = 127 - representation of a zero exponent. @@ -110,7 +113,8 @@ so to obtain float values *sign*, *exponent* and *mantissa* are set as follows: So the resulting float value is: -.. code-block:: cpp +.. code-block:: xml + :force: val = ((exponent << 23) | x & 0x7fffffu) - 1.0, @@ -125,7 +129,8 @@ Double is formatted as follows: *sign* (1 bit) *exponent* (11 bits) *mantissa* ( so to obtain double values *sign*, *exponent* and *mantissa* are set as follows: -.. code-block:: cpp +.. code-block:: xml + :force: sign = 0 exponent = 1023 - representation of a zero exponent. @@ -134,7 +139,8 @@ so to obtain double values *sign*, *exponent* and *mantissa* are set as follows: So the resulting double is obtained as follows: -.. code-block:: cpp +.. code-block:: xml + :force: mantissa_h = x0 & 0xfffffu; // upper 20 bits of mantissa mantissa_l = x1; // lower 32 bits of mantissa @@ -164,7 +170,8 @@ where *x* is uint32 random value. Example 1. *RandomUniform* output with ``global_seed`` = 150, ``op_seed`` = 10, ``output_type`` = f32: -.. code-block:: cpp +.. code-block:: xml + :force: input_shape = [ 3, 3 ] output = [[0.7011236 0.30539632 0.93931055] @@ -174,7 +181,8 @@ Example 1. *RandomUniform* output with ``global_seed`` = 150, ``op_seed`` = 10, Example 2. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100, ``output_type`` = double: -.. code-block:: cpp +.. code-block:: xml + :force: input_shape = [ 2, 2 ] @@ -188,7 +196,8 @@ Example 2. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100, Example 3. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100, ``output_type`` = i32: -.. code-block:: cpp +.. code-block:: xml + :force: input_shape = [ 2, 3 ] @@ -244,7 +253,8 @@ Example 3. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100, *Example 1: IR example.* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/generation/Range_1.md b/docs/ops/generation/Range_1.md index 12833c994a3..20fc02958c1 100644 --- a/docs/ops/generation/Range_1.md +++ b/docs/ops/generation/Range_1.md @@ -59,7 +59,8 @@ where *Example 1: positive step* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -80,7 +81,8 @@ where *Example 2: negative step* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/generation/Range_4.md b/docs/ops/generation/Range_4.md index 9aedf7af68e..a98201428d7 100644 --- a/docs/ops/generation/Range_4.md +++ b/docs/ops/generation/Range_4.md @@ -73,7 +73,8 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf *Example 1: positive step* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -95,7 +96,8 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf *Example 2: negative step* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -117,7 +119,8 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf *Example 3: floating-point* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/GridSample_9.md b/docs/ops/image/GridSample_9.md index b6664e0b05c..30b17a8ae2c 100644 --- a/docs/ops/image/GridSample_9.md +++ b/docs/ops/image/GridSample_9.md @@ -68,7 +68,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/I420toBGR_8.md b/docs/ops/image/I420toBGR_8.md index c619e0e420a..1f19fa57055 100644 --- a/docs/ops/image/I420toBGR_8.md +++ b/docs/ops/image/I420toBGR_8.md @@ -38,7 +38,8 @@ Same as specified for :doc:`I420toRGB ` ope *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -62,7 +63,8 @@ Same as specified for :doc:`I420toRGB ` ope *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/I420toRGB_8.md b/docs/ops/image/I420toRGB_8.md index 8a4d42c9e5c..bcad5ee5f00 100644 --- a/docs/ops/image/I420toRGB_8.md +++ b/docs/ops/image/I420toRGB_8.md @@ -81,7 +81,8 @@ Input I420 image tensor shall have ``NHWC (also known as NYXC)`` layout and can *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -105,7 +106,8 @@ Input I420 image tensor shall have ``NHWC (also known as NYXC)`` layout and can *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/Interpolate_1.md b/docs/ops/image/Interpolate_1.md index 59770281846..4835aba1d16 100644 --- a/docs/ops/image/Interpolate_1.md +++ b/docs/ops/image/Interpolate_1.md @@ -76,7 +76,8 @@ This is a scalar that specifies padding for each spatial dimension. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/Interpolate_11.md b/docs/ops/image/Interpolate_11.md index 92585a5c5ef..23d59fa923b 100644 --- a/docs/ops/image/Interpolate_11.md +++ b/docs/ops/image/Interpolate_11.md @@ -114,7 +114,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/Interpolate_4.md b/docs/ops/image/Interpolate_4.md index 2fb4a37edb0..82f68ea7a85 100644 --- a/docs/ops/image/Interpolate_4.md +++ b/docs/ops/image/Interpolate_4.md @@ -120,7 +120,8 @@ **Detailed description** Calculations are performed according to the following rules. -.. code-block:: python +.. code-block:: py + :force: import math import numpy as np @@ -601,7 +602,8 @@ Calculations are performed according to the following rules. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/NV12toBGR_8.md b/docs/ops/image/NV12toBGR_8.md index 0c9cf5f2825..d0ed0f9fb40 100644 --- a/docs/ops/image/NV12toBGR_8.md +++ b/docs/ops/image/NV12toBGR_8.md @@ -38,7 +38,8 @@ Same as specified for :doc:`NV12toRGB ` ope *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -62,7 +63,8 @@ Same as specified for :doc:`NV12toRGB ` ope *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/image/NV12toRGB_8.md b/docs/ops/image/NV12toRGB_8.md index 3b5c94e6631..214b62e5a1a 100644 --- a/docs/ops/image/NV12toRGB_8.md +++ b/docs/ops/image/NV12toRGB_8.md @@ -70,7 +70,8 @@ Input NV12 image tensor shall have ``NHWC (also known as NYXC)`` layout and can *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -94,7 +95,8 @@ Input NV12 image tensor shall have ``NHWC (also known as NYXC)`` layout and can *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/infrastructure/Assign_3.md b/docs/ops/infrastructure/Assign_3.md index 55b2409494f..39525e63dad 100644 --- a/docs/ops/infrastructure/Assign_3.md +++ b/docs/ops/infrastructure/Assign_3.md @@ -37,7 +37,8 @@ declared in ``variable_id`` and returns an error otherwise. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/infrastructure/Constant_1.md b/docs/ops/infrastructure/Constant_1.md index 85ff739809e..12a6be5887d 100644 --- a/docs/ops/infrastructure/Constant_1.md +++ b/docs/ops/infrastructure/Constant_1.md @@ -54,7 +54,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/infrastructure/Loop_5.md b/docs/ops/infrastructure/Loop_5.md index 6ac4306bf22..a379f88dcd3 100644 --- a/docs/ops/infrastructure/Loop_5.md +++ b/docs/ops/infrastructure/Loop_5.md @@ -166,7 +166,8 @@ Loop operation description in the IR also has several special sections: ``body`` *Example 1: a typical Loop structure* -.. code-block:: cpp +.. code-block:: xml + :force: ... diff --git a/docs/ops/infrastructure/Parameter_1.md b/docs/ops/infrastructure/Parameter_1.md index 57fa733fbaf..a6c09653847 100644 --- a/docs/ops/infrastructure/Parameter_1.md +++ b/docs/ops/infrastructure/Parameter_1.md @@ -39,19 +39,20 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - element_type="f32" shape="1,3,224,224" - - - 1 - 3 - 224 - 224 - - - + + element_type="f32" shape="1,3,224,224" + + + 1 + 3 + 224 + 224 + + + @endsphinxdirective diff --git a/docs/ops/infrastructure/ReadValue_3.md b/docs/ops/infrastructure/ReadValue_3.md index e2dd6911369..3faaa44b1ae 100644 --- a/docs/ops/infrastructure/ReadValue_3.md +++ b/docs/ops/infrastructure/ReadValue_3.md @@ -39,7 +39,8 @@ with the shape and type from the 1 input. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/infrastructure/Result_1.md b/docs/ops/infrastructure/Result_1.md index 71050a310c3..4fc32760ba2 100644 --- a/docs/ops/infrastructure/Result_1.md +++ b/docs/ops/infrastructure/Result_1.md @@ -26,7 +26,8 @@ No attributes available. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/infrastructure/TensorIterator_1.md b/docs/ops/infrastructure/TensorIterator_1.md index 3ff7c03ecc5..0ab1ad32675 100644 --- a/docs/ops/infrastructure/TensorIterator_1.md +++ b/docs/ops/infrastructure/TensorIterator_1.md @@ -151,7 +151,8 @@ where ``Si`` is value of ``Result`` operation at i-th iteration in the tensor it *Example 1: a typical TensorIterator structure* -.. code-block:: cpp +.. code-block:: xml + :force: ... @@ -176,7 +177,8 @@ where ``Si`` is value of ``Result`` operation at i-th iteration in the tensor it *Example 2: a full TensorIterator layer* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/logical/LogicalAnd_1.md b/docs/ops/logical/LogicalAnd_1.md index 97ebb1f4d44..ea4f80f0462 100644 --- a/docs/ops/logical/LogicalAnd_1.md +++ b/docs/ops/logical/LogicalAnd_1.md @@ -53,7 +53,8 @@ After broadcasting *LogicalAnd* does the following with the input tensors *a* an *Example 1: no broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -77,7 +78,8 @@ After broadcasting *LogicalAnd* does the following with the input tensors *a* an *Example 2: numpy broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/logical/LogicalNot_1.md b/docs/ops/logical/LogicalNot_1.md index e41a0d5b600..08fa79bae5e 100644 --- a/docs/ops/logical/LogicalNot_1.md +++ b/docs/ops/logical/LogicalNot_1.md @@ -40,7 +40,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/logical/LogicalOr_1.md b/docs/ops/logical/LogicalOr_1.md index c89985a68da..f5d71ea86e4 100644 --- a/docs/ops/logical/LogicalOr_1.md +++ b/docs/ops/logical/LogicalOr_1.md @@ -53,7 +53,8 @@ After broadcasting *LogicalOr* does the following with the input tensors *a* and *Example 1: no broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -76,7 +77,8 @@ After broadcasting *LogicalOr* does the following with the input tensors *a* and *Example 2: numpy broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/logical/LogicalXor_1.md b/docs/ops/logical/LogicalXor_1.md index 139ae64b488..6ccdbb14c67 100644 --- a/docs/ops/logical/LogicalXor_1.md +++ b/docs/ops/logical/LogicalXor_1.md @@ -53,7 +53,8 @@ After broadcasting *LogicalXor* does the following with the input tensors *a* an *Example 1: no broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -77,7 +78,8 @@ After broadcasting *LogicalXor* does the following with the input tensors *a* an *Example 2: numpy broadcast* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/matrix/Einsum_7.md b/docs/ops/matrix/Einsum_7.md index 45938a9352d..b0100f161b1 100644 --- a/docs/ops/matrix/Einsum_7.md +++ b/docs/ops/matrix/Einsum_7.md @@ -183,7 +183,8 @@ Example 8 shows how *Einsum* operates with an equation containing both capital a **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -204,7 +205,8 @@ Example 8 shows how *Einsum* operates with an equation containing both capital a -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/matrix/MatMul_1.md b/docs/ops/matrix/MatMul_1.md index 0a96ed48b18..54e1dcd8456 100644 --- a/docs/ops/matrix/MatMul_1.md +++ b/docs/ops/matrix/MatMul_1.md @@ -80,7 +80,8 @@ Two attributes, ``transpose_a`` and ``transpose_b`` specify embedded transpositi *Vector-matrix multiplication* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -102,7 +103,8 @@ Two attributes, ``transpose_a`` and ``transpose_b`` specify embedded transpositi *Matrix-vector multiplication* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -124,7 +126,8 @@ Two attributes, ``transpose_a`` and ``transpose_b`` specify embedded transpositi *Matrix-matrix multiplication (like FullyConnected with batch size 1)* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -148,7 +151,8 @@ Two attributes, ``transpose_a`` and ``transpose_b`` specify embedded transpositi *Vector-matrix multiplication with embedded transposition of the second matrix* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -171,7 +175,8 @@ Two attributes, ``transpose_a`` and ``transpose_b`` specify embedded transpositi *Matrix-matrix multiplication (like FullyConnected with batch size 10)* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -195,7 +200,8 @@ Two attributes, ``transpose_a`` and ``transpose_b`` specify embedded transpositi *Multiplication of batch of 5 matrices by a one matrix with broadcasting* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/BatchToSpace_2.md b/docs/ops/movement/BatchToSpace_2.md index e1b7408ddfc..b75235693ff 100644 --- a/docs/ops/movement/BatchToSpace_2.md +++ b/docs/ops/movement/BatchToSpace_2.md @@ -76,7 +76,8 @@ Where Example: 2D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: @@ -104,7 +105,8 @@ Example: 2D input tensor ``data`` Example: 5D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Broadcast_1.md b/docs/ops/movement/Broadcast_1.md index e7d0caaecec..27bc8cdca26 100644 --- a/docs/ops/movement/Broadcast_1.md +++ b/docs/ops/movement/Broadcast_1.md @@ -49,7 +49,8 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Broadcast_3.md b/docs/ops/movement/Broadcast_3.md index ab901ff28a2..e14175b93f5 100644 --- a/docs/ops/movement/Broadcast_3.md +++ b/docs/ops/movement/Broadcast_3.md @@ -57,7 +57,8 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Concat_1.md b/docs/ops/movement/Concat_1.md index 8029e485c83..d0a43c0e47a 100644 --- a/docs/ops/movement/Concat_1.md +++ b/docs/ops/movement/Concat_1.md @@ -35,7 +35,8 @@ **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -70,7 +71,8 @@ -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/DepthToSpace_1.md b/docs/ops/movement/DepthToSpace_1.md index 2d971f0d46a..8119939effc 100644 --- a/docs/ops/movement/DepthToSpace_1.md +++ b/docs/ops/movement/DepthToSpace_1.md @@ -66,7 +66,8 @@ If ``mode = depth_first``: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/ExtractImagePatches_3.md b/docs/ops/movement/ExtractImagePatches_3.md index 7a8d3412cdd..bc8cbfac1e7 100644 --- a/docs/ops/movement/ExtractImagePatches_3.md +++ b/docs/ops/movement/ExtractImagePatches_3.md @@ -67,7 +67,8 @@ The "auto_pad" attribute has no effect on the size of each patch, it determines **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/GatherElements_6.md b/docs/ops/movement/GatherElements_6.md index 8957420fe7d..54cc42bae9f 100644 --- a/docs/ops/movement/GatherElements_6.md +++ b/docs/ops/movement/GatherElements_6.md @@ -22,7 +22,7 @@ and has the same shape as ``indices``. For instance, in the 3D case (``r = 3``), the output is determined by the following equations: -.. code-block:: +.. code-block:: sh out[i][j][k] = data[indices[i][j][k]][j][k] if axis = 0 out[i][j][k] = data[i][indices[i][j][k]][k] if axis = 1 @@ -30,7 +30,7 @@ For instance, in the 3D case (``r = 3``), the output is determined by the follow Example 1 with concrete values: -.. code-block:: +.. code-block:: sh data = [ [1, 2], @@ -48,7 +48,7 @@ Example 1 with concrete values: Example 2 with ``axis`` = 1 and ``indices`` having greater (than ``data``) shape: -.. code-block:: +.. code-block:: sh data = [ [1, 7], @@ -67,7 +67,7 @@ Example 2 with ``axis`` = 1 and ``indices`` having greater (than ``data``) shape Example 3 ``indices`` has lesser (than ``data``) shape: -.. code-block:: +.. code-block:: sh data = [ [1, 2, 3], @@ -111,7 +111,8 @@ Example 3 ``indices`` has lesser (than ``data``) shape: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: <... type="GatherElements" ...> diff --git a/docs/ops/movement/GatherND_5.md b/docs/ops/movement/GatherND_5.md index e6e9e4ba1fb..76906c7dc2f 100644 --- a/docs/ops/movement/GatherND_5.md +++ b/docs/ops/movement/GatherND_5.md @@ -28,7 +28,7 @@ The shape of the output can be computed as `indices.shape[:-1] + data.shape[indi Example 1 shows how *GatherND* operates with elements from `data` tensor: -.. code-block:: +.. code-block:: sh indices = [[0, 0], [1, 0]] @@ -39,7 +39,7 @@ Example 1 shows how *GatherND* operates with elements from `data` tensor: Example 2 shows how *GatherND* operates with slices from ``data`` tensor: -.. code-block:: +.. code-block:: sh indices = [[1], [0]] data = [[1, 2], @@ -50,7 +50,7 @@ Example 2 shows how *GatherND* operates with slices from ``data`` tensor: Example 3 shows how *GatherND* operates when `indices` tensor has leading dimensions: -.. code-block:: +.. code-block:: sh indices = [[[1]], [[0]]] data = [[1, 2], @@ -81,7 +81,7 @@ Example 3 shows how *GatherND* operates when `indices` tensor has leading dimens Example 4 shows how *GatherND* operates gathering elements for non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 1 indices = [[1], <--- this is applied to the first batch @@ -93,7 +93,7 @@ Example 4 shows how *GatherND* operates gathering elements for non-default *batc Example 5 shows how *GatherND* operates gathering slices for non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 1 indices = [[1], <--- this is applied to the first batch @@ -106,7 +106,7 @@ Example 5 shows how *GatherND* operates gathering slices for non-default *batch_ More complex, example 6 shows how *GatherND* operates gathering slices with leading dimensions for non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 2 indices = [[[[1]], <--- this is applied to the first batch @@ -144,7 +144,8 @@ for non-default *batch_dims* value: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -171,7 +172,8 @@ for non-default *batch_dims* value: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/GatherND_8.md b/docs/ops/movement/GatherND_8.md index e383fa9169a..cf9e1e0eeb5 100644 --- a/docs/ops/movement/GatherND_8.md +++ b/docs/ops/movement/GatherND_8.md @@ -65,7 +65,7 @@ if ``indices.shape[-1] == data.rank - batch_dims``, else Example 1 shows how *GatherND* operates with elements from ``data`` tensor: -.. code-block:: +.. code-block:: sh indices = [[0, 0], [1, 0]] @@ -76,7 +76,7 @@ Example 1 shows how *GatherND* operates with elements from ``data`` tensor: Example 2 shows how *GatherND* operates with slices from ``data`` tensor: -.. code-block:: +.. code-block:: sh indices = [[1], [0]] data = [[1, 2], @@ -87,7 +87,7 @@ Example 2 shows how *GatherND* operates with slices from ``data`` tensor: Example 3 shows how *GatherND* operates when ``indices`` tensor has leading dimensions: -.. code-block:: +.. code-block:: sh indices = [[[1]], [[0]]] data = [[1, 2], @@ -98,7 +98,7 @@ Example 3 shows how *GatherND* operates when ``indices`` tensor has leading dime Example 4 shows how *GatherND* operates gathering elements for non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 1 indices = [[1], <--- this is applied to the first batch @@ -110,7 +110,7 @@ Example 4 shows how *GatherND* operates gathering elements for non-default *batc Example 5 shows how *GatherND* operates gathering slices for non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 1 indices = [[1], <--- this is applied to the first batch @@ -123,7 +123,7 @@ Example 5 shows how *GatherND* operates gathering slices for non-default *batch_ More complex examples 6 and 7 show how *GatherND* operates gathering slices with leading dimensions for non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 2 indices = [[[[1]], <--- this is applied to the first batch @@ -144,7 +144,7 @@ for non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 3 indices = [[[[1], @@ -162,7 +162,8 @@ for non-default *batch_dims* value: ], shape = (1, 2, 2) -.. code-block:: cpp +.. code-block:: xml + :force: @@ -189,7 +190,8 @@ for non-default *batch_dims* value: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -218,7 +220,8 @@ for non-default *batch_dims* value: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/GatherTree_1.md b/docs/ops/movement/GatherTree_1.md index b3660facfdd..cc9c6508712 100644 --- a/docs/ops/movement/GatherTree_1.md +++ b/docs/ops/movement/GatherTree_1.md @@ -20,7 +20,8 @@ first decoded ``end_token`` all values are filled in with ``end_token``. The algorithm in pseudocode is as follows: -.. code-block:: python +.. code-block:: py + :force: final_ids[ :, :, :] = end_token for batch in range(BATCH_SIZE): @@ -72,7 +73,8 @@ The algorithm in pseudocode is as follows: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Gather_1.md b/docs/ops/movement/Gather_1.md index 6fb170e9c92..5e72934d916 100644 --- a/docs/ops/movement/Gather_1.md +++ b/docs/ops/movement/Gather_1.md @@ -15,7 +15,7 @@ to the indices specified in the second input tensor and axis from the third inpu **Detailed description** -.. code-block:: +.. code-block:: sh output[p_0, p_1, ..., p_{axis-1}, i, ..., j, ...] = input1[p_0, p_1, ..., p_{axis-1}, input2[i, ..., j], ...] @@ -39,7 +39,8 @@ Where ``axis`` is the value from the third input. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Gather_7.md b/docs/ops/movement/Gather_7.md index 411079cfb2b..e22192ad451 100644 --- a/docs/ops/movement/Gather_7.md +++ b/docs/ops/movement/Gather_7.md @@ -16,7 +16,7 @@ TensorFlow `Gather `__ ope **Detailed description** -.. code-block:: +.. code-block:: sh output[p_0, p_1, ..., p_{axis-1}, i_b, ..., i_{M-1}, p_{axis+1}, ..., p_{N-1}] = data[p_0, p_1, ..., p_{axis-1}, indices[p_0, p_1, ..., p_{b-1}, i_b, ..., i_{M-1}], p_{axis+1}, ..., p_{N-1}] @@ -40,7 +40,7 @@ the number of batch dimensions. ``N`` and ``M`` are numbers of dimensions of ``d Example 1 with default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 0 axis = 0 @@ -52,7 +52,7 @@ Example 1 with default *batch_dims* value: Example 2 with non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 1 axis = 1 @@ -72,7 +72,7 @@ Example 2 with non-default *batch_dims* value: Example 3 with non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 2 axis = 2 @@ -100,7 +100,7 @@ Example 3 with non-default *batch_dims* value: Example 4 with *axis* > *batch_dims*: -.. code-block:: +.. code-block:: sh batch_dims = 1 axis = 2 @@ -134,7 +134,7 @@ Example 4 with *axis* > *batch_dims*: Example 5 with negative *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = -1 <-- normalized value will be indices.rank + batch_dims = 2 - 1 = 1 axis = 1 diff --git a/docs/ops/movement/Gather_8.md b/docs/ops/movement/Gather_8.md index 346f5c3635d..ef68b143293 100644 --- a/docs/ops/movement/Gather_8.md +++ b/docs/ops/movement/Gather_8.md @@ -18,7 +18,7 @@ support of negative indices. **Detailed description** -.. code-block:: +.. code-block:: sh output[p_0, p_1, ..., p_{axis-1}, i_b, ..., i_{M-1}, p_{axis+1}, ..., p_{N-1}] = data[p_0, p_1, ..., p_{axis-1}, indices[p_0, p_1, ..., p_{b-1}, i_b, ..., i_{M-1}], p_{axis+1}, ..., p_{N-1}] @@ -44,7 +44,7 @@ range output data for corresponding index will be filled with zeros (Example 7). Example 1 with default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 0 axis = 0 @@ -55,7 +55,7 @@ Example 1 with default *batch_dims* value: Example 2 with non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 1 axis = 1 @@ -75,7 +75,7 @@ Example 2 with non-default *batch_dims* value: Example 3 with non-default *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = 2 axis = 2 @@ -103,7 +103,7 @@ Example 3 with non-default *batch_dims* value: Example 4 with *axis* > *batch_dims*: -.. code-block:: +.. code-block:: sh batch_dims = 1 axis = 2 @@ -137,7 +137,7 @@ Example 4 with *axis* > *batch_dims*: Example 5 with negative *batch_dims* value: -.. code-block:: +.. code-block:: sh batch_dims = -1 <-- normalized value will be indices.rank + batch_dims = 2 - 1 = 1 axis = 1 @@ -157,7 +157,7 @@ Example 5 with negative *batch_dims* value: Example 6 with negative indices: -.. code-block:: +.. code-block:: sh batch_dims = 0 axis = 0 @@ -169,7 +169,7 @@ Example 6 with negative indices: Example 7 with indices out of the range: -.. code-block:: +.. code-block:: sh batch_dims = 0 axis = 0 @@ -203,7 +203,8 @@ of the output tensor is ``data.shape[:axis] + indices.shape[batch_dims:] + data. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Pad_1.md b/docs/ops/movement/Pad_1.md index ba7a89dfd40..d16df20cb35 100644 --- a/docs/ops/movement/Pad_1.md +++ b/docs/ops/movement/Pad_1.md @@ -118,7 +118,8 @@ depending on the *pad_mode*. **Example**: constant mode -.. code-block:: cpp +.. code-block:: xml + :force: @@ -153,7 +154,8 @@ depending on the *pad_mode*. **Example**: edge mode -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Pad_12.md b/docs/ops/movement/Pad_12.md index 647e799b826..6e3e629833a 100644 --- a/docs/ops/movement/Pad_12.md +++ b/docs/ops/movement/Pad_12.md @@ -208,7 +208,8 @@ Mixed pads example: **Example**: constant mode (positive pads) -.. code-block:: cpp +.. code-block:: xml + :force: @@ -243,7 +244,8 @@ Mixed pads example: **Example**: constant mode (positive and negative pads) -.. code-block:: cpp +.. code-block:: xml + :force: @@ -278,7 +280,8 @@ Mixed pads example: **Example**: edge mode -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/ReverseSequence_1.md b/docs/ops/movement/ReverseSequence_1.md index 03389f373d6..c1ed72974db 100644 --- a/docs/ops/movement/ReverseSequence_1.md +++ b/docs/ops/movement/ReverseSequence_1.md @@ -50,7 +50,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Reverse_1.md b/docs/ops/movement/Reverse_1.md index 442bc8cbc96..9a59e9c901f 100644 --- a/docs/ops/movement/Reverse_1.md +++ b/docs/ops/movement/Reverse_1.md @@ -47,7 +47,8 @@ If no axis specified, that means either the second input is empty if ``index`` m **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Roll_7.md b/docs/ops/movement/Roll_7.md index 57dc015573c..5c04764c56e 100644 --- a/docs/ops/movement/Roll_7.md +++ b/docs/ops/movement/Roll_7.md @@ -83,7 +83,8 @@ No attributes available. *Example 1: "shift" and "axes" are 1D tensors.* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -113,7 +114,8 @@ No attributes available. *Example 2: "shift" value is a scalar and multiple axes are specified.* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/ScatterElementsUpdate_3.md b/docs/ops/movement/ScatterElementsUpdate_3.md index cc93ab4facc..cd5bccb9930 100644 --- a/docs/ops/movement/ScatterElementsUpdate_3.md +++ b/docs/ops/movement/ScatterElementsUpdate_3.md @@ -56,7 +56,8 @@ The value can be in range ``[-r, r - 1]`` where ``r`` is the rank of ``data``. * **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/ScatterNDUpdate_3.md b/docs/ops/movement/ScatterNDUpdate_3.md index 48a2eb9b1ec..ffcaf7f6fa5 100644 --- a/docs/ops/movement/ScatterNDUpdate_3.md +++ b/docs/ops/movement/ScatterNDUpdate_3.md @@ -70,7 +70,8 @@ Example 2 that shows update of two slices of ``4x4`` shape in ``data``: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/ScatterUpdate_3.md b/docs/ops/movement/ScatterUpdate_3.md index 1b4e57700e3..47c673724eb 100644 --- a/docs/ops/movement/ScatterUpdate_3.md +++ b/docs/ops/movement/ScatterUpdate_3.md @@ -58,7 +58,8 @@ The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``dat *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -95,7 +96,8 @@ The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``dat *Example 2* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/ShuffleChannels_1.md b/docs/ops/movement/ShuffleChannels_1.md index 23c5fa7bd0c..37eea17f7c6 100644 --- a/docs/ops/movement/ShuffleChannels_1.md +++ b/docs/ops/movement/ShuffleChannels_1.md @@ -74,7 +74,8 @@ where ``group`` is the layer attribute described below. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Slice_8.md b/docs/ops/movement/Slice_8.md index 8b093babb33..dc14df733fe 100644 --- a/docs/ops/movement/Slice_8.md +++ b/docs/ops/movement/Slice_8.md @@ -75,366 +75,378 @@ Number of elements in ``start``, ``stop``, ``step``, and ``axes`` inputs are req Example 1: basic slicing -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [1] --> - 1 - - < !-- stop: [8] --> - 1 - - < !-- step: [1] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [1, 2, 3, 4, 5, 6, 7] --> - 7 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [1] --> + 1 + + < !-- stop: [8] --> + 1 + + < !-- step: [1] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [1, 2, 3, 4, 5, 6, 7] --> + 7 + + + Example 2: basic slicing, ``axes`` default -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [1] --> - 1 - - < !-- stop: [8] --> - 1 - - < !-- step: [1] --> - 1 - - - - < !-- output: [1, 2, 3, 4, 5, 6, 7] --> - 7 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [1] --> + 1 + + < !-- stop: [8] --> + 1 + + < !-- step: [1] --> + 1 + + + + < !-- output: [1, 2, 3, 4, 5, 6, 7] --> + 7 + + + Example 3: basic slicing, ``step: [2]`` -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [1] --> - 1 - - < !-- stop: [8] --> - 1 - - < !-- step: [2] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [1, 3, 5, 7] --> - 4 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [1] --> + 1 + + < !-- stop: [8] --> + 1 + + < !-- step: [2] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [1, 3, 5, 7] --> + 4 + + + Example 4: ``start`` and ``stop`` out of the dimension size, ``step: [1]`` -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [-100] --> - 1 - - < !-- stop: [100] --> - 1 - - < !-- step: [1] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [-100] --> + 1 + + < !-- stop: [100] --> + 1 + + < !-- step: [1] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + + Example 5: slicing backward all elements, ``step: [-1]``, ``stop: [-11]`` -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [9] --> - 1 - - < !-- stop: [-11] --> - 1 - - < !-- step: [-1] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] --> - 10 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [9] --> + 1 + + < !-- stop: [-11] --> + 1 + + < !-- step: [-1] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] --> + 10 + + + Example 6: slicing backward, ``step: [-1]``, ``stop: [0]`` -.. code-block:: cpp - - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [9] --> - 1 - - < !-- stop: [0] --> - 1 - - < !-- step: [-1] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] --> - 9 - - - +.. code-block:: xml + :force: + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [9] --> + 1 + + < !-- stop: [0] --> + 1 + + < !-- step: [-1] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] --> + 9 + + + + Example 7: slicing backward, ``step: [-1]``, ``stop: [-10]`` -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [9] --> - 1 - - < !-- stop: [-10] --> - 1 - - < !-- step: [-1] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] --> - 9 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [9] --> + 1 + + < !-- stop: [-10] --> + 1 + + < !-- step: [-1] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] --> + 9 + + + Example 8: slicing backward, ``step: [-2]`` -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [9] --> - 1 - - < !-- stop: [-11] --> - 1 - - < !-- step: [-2] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [9, 7, 5, 3, 1] --> - 5 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [9] --> + 1 + + < !-- stop: [-11] --> + 1 + + < !-- step: [-2] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [9, 7, 5, 3, 1] --> + 5 + + + Example 9: ``start`` and ``stop`` out of the dimension size, slicing backward -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> - 10 - - < !-- start: [100] --> - 1 - - < !-- stop: [-100] --> - 1 - - < !-- step: [-1] --> - 1 - - < !-- axes: [0] --> - 1 - - - - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] --> - 10 - - - + + + < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 + + < !-- start: [100] --> + 1 + + < !-- stop: [-100] --> + 1 + + < !-- step: [-1] --> + 1 + + < !-- axes: [0] --> + 1 + + + + < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] --> + 10 + + + Example 10: slicing 2D tensor, all axes specified -.. code-block:: cpp - - - - < !-- data: data: [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] --> - 2 - 5 - - < !-- start: [0, 1] --> - 2 - - < !-- stop: [2, 4] --> - 2 - - < !-- step: [1, 2] --> - 2 - - < !-- axes: [0, 1] --> - 2 - - - - < !-- output: [1, 3, 6, 8] --> - 2 - 2 - - - +.. code-block:: xml + :force: + + + < !-- data: data: [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] --> + 2 + 5 + + < !-- start: [0, 1] --> + 2 + + < !-- stop: [2, 4] --> + 2 + + < !-- step: [1, 2] --> + 2 + + < !-- axes: [0, 1] --> + 2 + + + + < !-- output: [1, 3, 6, 8] --> + 2 + 2 + + + + Example 11: slicing 3D tensor, all axes specified -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data --> - 20 - 10 - 5 - - < !-- start: [0, 0, 0] --> - 2 - - < !-- stop: [4, 10, 5] --> - 2 - - < !-- step: [1, 1, 1] --> - 2 - - < !-- axes: [0, 1, 2] --> - 2 - - - - < !-- output --> - 4 - 10 - 5 - - - + + + < !-- data --> + 20 + 10 + 5 + + < !-- start: [0, 0, 0] --> + 2 + + < !-- stop: [4, 10, 5] --> + 2 + + < !-- step: [1, 1, 1] --> + 2 + + < !-- axes: [0, 1, 2] --> + 2 + + + + < !-- output --> + 4 + 10 + 5 + + + Example 12: slicing 3D tensor, last axes default -.. code-block:: cpp +.. code-block:: xml + :force: - - - < !-- data --> - 20 - 10 - 5 - - < !-- start: [0, 0] --> - 2 - - < !-- stop: [4, 10] --> - 2 - - < !-- step: [1, 1] --> - 2 - - < !-- axes: [0, 1] --> - 2 - - - - < !-- output --> - 4 - 10 - 5 - - - + + + < !-- data --> + 20 + 10 + 5 + + < !-- start: [0, 0] --> + 2 + + < !-- stop: [4, 10] --> + 2 + + < !-- step: [1, 1] --> + 2 + + < !-- axes: [0, 1] --> + 2 + + + + < !-- output --> + 4 + 10 + 5 + + + @endsphinxdirective diff --git a/docs/ops/movement/SpaceToBatch_2.md b/docs/ops/movement/SpaceToBatch_2.md index 1abdbecd45a..4b99912ca14 100644 --- a/docs/ops/movement/SpaceToBatch_2.md +++ b/docs/ops/movement/SpaceToBatch_2.md @@ -72,7 +72,8 @@ No attributes available. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/SpaceToDepth_1.md b/docs/ops/movement/SpaceToDepth_1.md index e0c36f0eb19..79e7a0d3c00 100644 --- a/docs/ops/movement/SpaceToDepth_1.md +++ b/docs/ops/movement/SpaceToDepth_1.md @@ -71,7 +71,8 @@ If ``mode = depth_first``: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Split_1.md b/docs/ops/movement/Split_1.md index 9821155fb3a..18800fe9915 100644 --- a/docs/ops/movement/Split_1.md +++ b/docs/ops/movement/Split_1.md @@ -50,7 +50,8 @@ Where D is the rank of input tensor ``data``. The axis being split must be evenl **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/StridedSlice_1.md b/docs/ops/movement/StridedSlice_1.md index fc1cec4f25e..c447979308e 100644 --- a/docs/ops/movement/StridedSlice_1.md +++ b/docs/ops/movement/StridedSlice_1.md @@ -74,7 +74,8 @@ **Example** Example of ``begin_mask`` & ``end_mask`` usage. -.. code-block:: cpp +.. code-block:: xml + :force: @@ -106,8 +107,8 @@ Example of ``begin_mask`` & ``end_mask`` usage. Example of ``new_axis_mask`` usage. -.. code-block:: cpp - +.. code-block:: xml + :force: @@ -139,7 +140,8 @@ Example of ``new_axis_mask`` usage. Example of ``shrink_axis_mask`` usage. -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Tile_1.md b/docs/ops/movement/Tile_1.md index fd661e54251..671fc6e81cb 100644 --- a/docs/ops/movement/Tile_1.md +++ b/docs/ops/movement/Tile_1.md @@ -49,7 +49,8 @@ No attributes available. *Example 1: number elements in "repeats" is equal to shape of data* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -73,7 +74,8 @@ No attributes available. *Example 2: number of elements in "repeats" is more than shape of "data"* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -98,7 +100,8 @@ No attributes available. *Example 3: number of elements in "repeats" is less than shape of "data"* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Transpose_1.md b/docs/ops/movement/Transpose_1.md index 1af2e84ac95..41eda58c351 100644 --- a/docs/ops/movement/Transpose_1.md +++ b/docs/ops/movement/Transpose_1.md @@ -40,7 +40,8 @@ *Example 1* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -65,7 +66,8 @@ *Example 2: input_order = empty 1D tensor of Shape[0]* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/Unique_10.md b/docs/ops/movement/Unique_10.md index 249daac8fcf..ec5b3f0597f 100644 --- a/docs/ops/movement/Unique_10.md +++ b/docs/ops/movement/Unique_10.md @@ -66,7 +66,8 @@ The operator can either work in elementwise mode searching for unique values in *Example 1: axis input connected to a constant containing a 'zero'* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -101,7 +102,8 @@ The operator can either work in elementwise mode searching for unique values in *Example 2: no axis provided* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -128,7 +130,8 @@ The operator can either work in elementwise mode searching for unique values in *Example 3: no axis provided, non-default outputs precision* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/movement/VariadicSplit_1.md b/docs/ops/movement/VariadicSplit_1.md index 0479c0b2b52..c3ec920a67c 100644 --- a/docs/ops/movement/VariadicSplit_1.md +++ b/docs/ops/movement/VariadicSplit_1.md @@ -42,7 +42,8 @@ Where D is the rank of input tensor `data`. The sum of elements in ``split_lengt **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Where D is the rank of input tensor `data`. The sum of elements in ``split_lengt -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/BatchNormInference_1.md b/docs/ops/normalization/BatchNormInference_1.md index 928d2389842..cfd16a71b8b 100644 --- a/docs/ops/normalization/BatchNormInference_1.md +++ b/docs/ops/normalization/BatchNormInference_1.md @@ -104,7 +104,8 @@ For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m valu Example: 2D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: @@ -136,7 +137,8 @@ Example: 2D input tensor ``data`` Example: 4D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/BatchNormInference_5.md b/docs/ops/normalization/BatchNormInference_5.md index aa090de94da..7f80a3bad0e 100644 --- a/docs/ops/normalization/BatchNormInference_5.md +++ b/docs/ops/normalization/BatchNormInference_5.md @@ -105,7 +105,8 @@ For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m valu Example: 2D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: @@ -137,7 +138,8 @@ Example: 2D input tensor ``data`` Example: 4D input tensor ``data`` -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/GRN_1.md b/docs/ops/normalization/GRN_1.md index ce6a7724646..b0761457f07 100644 --- a/docs/ops/normalization/GRN_1.md +++ b/docs/ops/normalization/GRN_1.md @@ -44,7 +44,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/GroupNormalization_12.md b/docs/ops/normalization/GroupNormalization_12.md index f8937ed2c6e..725261d52a4 100644 --- a/docs/ops/normalization/GroupNormalization_12.md +++ b/docs/ops/normalization/GroupNormalization_12.md @@ -56,7 +56,8 @@ The operation is applied per batch, per group of channels. This means that the e **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/LRN_1.md b/docs/ops/normalization/LRN_1.md index 7d7e34a0a8f..0cf04f9d593 100644 --- a/docs/ops/normalization/LRN_1.md +++ b/docs/ops/normalization/LRN_1.md @@ -90,7 +90,8 @@ Example for 4D ``data`` input tensor and ``axes = [2, 3]``: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/MVN_1.md b/docs/ops/normalization/MVN_1.md index 6d10bd05e7e..2f58f70775d 100644 --- a/docs/ops/normalization/MVN_1.md +++ b/docs/ops/normalization/MVN_1.md @@ -111,7 +111,8 @@ where :math:`\sigma_{k}^2` is the variance calculated based on mean value, :math *Example: with* ``across_channels`` *attribute* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -136,7 +137,8 @@ where :math:`\sigma_{k}^2` is the variance calculated based on mean value, :math *Example: with* ``reduction_axes`` *attribute* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/MVN_6.md b/docs/ops/normalization/MVN_6.md index aad5414527e..4b2a3fcaea6 100644 --- a/docs/ops/normalization/MVN_6.md +++ b/docs/ops/normalization/MVN_6.md @@ -85,7 +85,8 @@ If *normalize_variance* is set to ``true``, the output blob is divided by varian **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/normalization/NormalizeL2_1.md b/docs/ops/normalization/NormalizeL2_1.md index 03a14c204da..463eff1f4c9 100644 --- a/docs/ops/normalization/NormalizeL2_1.md +++ b/docs/ops/normalization/NormalizeL2_1.md @@ -64,7 +64,8 @@ Particular cases: Example: Normalization over channel dimension for ``NCHW`` layout -.. code-block:: cpp +.. code-block:: xml + :force: @@ -92,7 +93,8 @@ Example: Normalization over channel dimension for ``NCHW`` layout Example: Normalization over channel and spatial dimensions for ``NCHW`` layout -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/pooling/AdaptiveAvgPool_8.md b/docs/ops/pooling/AdaptiveAvgPool_8.md index c4eb41dce65..ffde1548f07 100644 --- a/docs/ops/pooling/AdaptiveAvgPool_8.md +++ b/docs/ops/pooling/AdaptiveAvgPool_8.md @@ -48,7 +48,8 @@ The output is calculated with the following formula: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/pooling/AdaptiveMaxPool_8.md b/docs/ops/pooling/AdaptiveMaxPool_8.md index 87ea96d505d..f53d0002aef 100644 --- a/docs/ops/pooling/AdaptiveMaxPool_8.md +++ b/docs/ops/pooling/AdaptiveMaxPool_8.md @@ -59,7 +59,8 @@ The output is calculated following this formula: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/pooling/AvgPool_1.md b/docs/ops/pooling/AvgPool_1.md index 07fa577e530..31041331a07 100644 --- a/docs/ops/pooling/AvgPool_1.md +++ b/docs/ops/pooling/AvgPool_1.md @@ -98,7 +98,8 @@ **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/pooling/MaxPool_1.md b/docs/ops/pooling/MaxPool_1.md index c1b2dd05ed3..b3b2115ef75 100644 --- a/docs/ops/pooling/MaxPool_1.md +++ b/docs/ops/pooling/MaxPool_1.md @@ -205,7 +205,8 @@ If ``H + pads_begin[i] + pads_end[i] - kernel[i]`` is not divided by ``strides[i **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/pooling/MaxPool_8.md b/docs/ops/pooling/MaxPool_8.md index c99b371c0bd..283b04b2739 100644 --- a/docs/ops/pooling/MaxPool_8.md +++ b/docs/ops/pooling/MaxPool_8.md @@ -303,7 +303,8 @@ If ``H + pads_begin[i] + pads_end[i] - kernel[i]`` is not divisible by ``strides **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/quantization/FakeQuantize_1.md b/docs/ops/quantization/FakeQuantize_1.md index e1031b90bc4..3d6a26a1ca0 100644 --- a/docs/ops/quantization/FakeQuantize_1.md +++ b/docs/ops/quantization/FakeQuantize_1.md @@ -26,7 +26,8 @@ specify minimum and maximum quantized values at the output. Each element of the output is defined as the result of the following expression: -.. code-block:: python +.. code-block:: py + :force: if x <= min(input_low, input_high): output = output_low @@ -76,7 +77,8 @@ Each element of the output is defined as the result of the following expression: **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceL1_4.md b/docs/ops/reduction/ReduceL1_4.md index bfa3a4c24be..f0024e92bc8 100644 --- a/docs/ops/reduction/ReduceL1_4.md +++ b/docs/ops/reduction/ReduceL1_4.md @@ -53,7 +53,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -80,7 +81,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -105,7 +107,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -131,7 +134,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceL2_4.md b/docs/ops/reduction/ReduceL2_4.md index ef15e847df7..84a96d5863a 100644 --- a/docs/ops/reduction/ReduceL2_4.md +++ b/docs/ops/reduction/ReduceL2_4.md @@ -53,7 +53,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -79,7 +80,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -103,7 +105,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -128,7 +131,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceLogicalAnd_1.md b/docs/ops/reduction/ReduceLogicalAnd_1.md index f586a5f80a7..1570061ab8e 100644 --- a/docs/ops/reduction/ReduceLogicalAnd_1.md +++ b/docs/ops/reduction/ReduceLogicalAnd_1.md @@ -55,7 +55,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -105,7 +107,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -130,7 +133,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceLogicalOr_1.md b/docs/ops/reduction/ReduceLogicalOr_1.md index 553741ead41..6db017f7661 100644 --- a/docs/ops/reduction/ReduceLogicalOr_1.md +++ b/docs/ops/reduction/ReduceLogicalOr_1.md @@ -55,7 +55,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -104,7 +106,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -129,7 +132,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceMax_1.md b/docs/ops/reduction/ReduceMax_1.md index 922bd13b226..e6262e1327c 100644 --- a/docs/ops/reduction/ReduceMax_1.md +++ b/docs/ops/reduction/ReduceMax_1.md @@ -55,7 +55,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -105,7 +107,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -130,7 +133,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceMean_1.md b/docs/ops/reduction/ReduceMean_1.md index 57497239958..91b6db0b7a7 100644 --- a/docs/ops/reduction/ReduceMean_1.md +++ b/docs/ops/reduction/ReduceMean_1.md @@ -55,7 +55,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -103,10 +105,10 @@ Particular cases: += - - -.. code-block:: cpp +.. code-block:: xml + :force: @@ -130,7 +132,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceMin_1.md b/docs/ops/reduction/ReduceMin_1.md index 27347cebdbc..b38776a18a0 100644 --- a/docs/ops/reduction/ReduceMin_1.md +++ b/docs/ops/reduction/ReduceMin_1.md @@ -55,7 +55,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -105,7 +107,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -130,7 +133,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceProd_1.md b/docs/ops/reduction/ReduceProd_1.md index e06392c12a9..05fc65d705d 100644 --- a/docs/ops/reduction/ReduceProd_1.md +++ b/docs/ops/reduction/ReduceProd_1.md @@ -55,7 +55,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -105,7 +107,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -130,7 +133,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/reduction/ReduceSum_1.md b/docs/ops/reduction/ReduceSum_1.md index 37d94466982..575dfcedd6a 100644 --- a/docs/ops/reduction/ReduceSum_1.md +++ b/docs/ops/reduction/ReduceSum_1.md @@ -55,7 +55,8 @@ Particular cases: **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -105,7 +107,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: @@ -130,7 +133,8 @@ Particular cases: -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sequence/CTCGreedyDecoderSeqLen_6.md b/docs/ops/sequence/CTCGreedyDecoderSeqLen_6.md index 455d1989b4b..dbeaed01d5b 100644 --- a/docs/ops/sequence/CTCGreedyDecoderSeqLen_6.md +++ b/docs/ops/sequence/CTCGreedyDecoderSeqLen_6.md @@ -73,7 +73,8 @@ The main difference between :doc:`CTCGreedyDecoder diff --git a/docs/ops/sequence/CTCGreedyDecoder_1.md b/docs/ops/sequence/CTCGreedyDecoder_1.md index cf5b60d8002..15da3e0716b 100644 --- a/docs/ops/sequence/CTCGreedyDecoder_1.md +++ b/docs/ops/sequence/CTCGreedyDecoder_1.md @@ -47,7 +47,8 @@ Sequences in the batch can have different length. The lengths of sequences are c **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sequence/CTCLoss_4.md b/docs/ops/sequence/CTCLoss_4.md index 0e90bb2ca7b..a486b0aeb44 100644 --- a/docs/ops/sequence/CTCLoss_4.md +++ b/docs/ops/sequence/CTCLoss_4.md @@ -96,7 +96,8 @@ Having log-probabilities for aligned paths, log of summed up probabilities for t **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sequence/GRUCell_3.md b/docs/ops/sequence/GRUCell_3.md index 2d6747c9b57..1d5cfe8bc12 100644 --- a/docs/ops/sequence/GRUCell_3.md +++ b/docs/ops/sequence/GRUCell_3.md @@ -14,7 +14,7 @@ **Detailed description**: *GRUCell* computes the output *Ht* for the current time step based on the followint formula: -.. code-block:: +.. code-block:: sh Formula: * - matrix multiplication @@ -90,7 +90,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sequence/GRUSequence_5.md b/docs/ops/sequence/GRUSequence_5.md index d50028359c6..39c8a67a2f6 100644 --- a/docs/ops/sequence/GRUSequence_5.md +++ b/docs/ops/sequence/GRUSequence_5.md @@ -104,7 +104,8 @@ are in sync with the specification of ONNX GRU operator defined **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sequence/LSTMCell_1.md b/docs/ops/sequence/LSTMCell_1.md index 948bab39122..b2089451ea4 100644 --- a/docs/ops/sequence/LSTMCell_1.md +++ b/docs/ops/sequence/LSTMCell_1.md @@ -89,7 +89,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sequence/OneHot_1.md b/docs/ops/sequence/OneHot_1.md index d0224f04190..f67dbd7e0fa 100644 --- a/docs/ops/sequence/OneHot_1.md +++ b/docs/ops/sequence/OneHot_1.md @@ -56,7 +56,8 @@ The types of input scalars ``on_value`` and ``off_value`` should match and be eq **Examples** -.. code-block:: cpp +.. code-block:: xml + :force: @@ -81,7 +82,8 @@ The types of input scalars ``on_value`` and ``off_value`` should match and be eq -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sequence/RNNCell_3.md b/docs/ops/sequence/RNNCell_3.md index bf8553df88a..bcbc220917d 100644 --- a/docs/ops/sequence/RNNCell_3.md +++ b/docs/ops/sequence/RNNCell_3.md @@ -80,37 +80,38 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 1 - 16 - - - 1 - 128 - - - 128 - 16 - - - 128 - 128 - - - 128 - - - - - 1 - 128 - - - + + + + + 1 + 16 + + + 1 + 128 + + + 128 + 16 + + + 128 + 128 + + + 128 + + + + + 1 + 128 + + + @endsphinxdirective diff --git a/docs/ops/sequence/RNNSequence_5.md b/docs/ops/sequence/RNNSequence_5.md index 959170d803a..66746edcec9 100644 --- a/docs/ops/sequence/RNNSequence_5.md +++ b/docs/ops/sequence/RNNSequence_5.md @@ -84,53 +84,54 @@ A single cell in the sequence is implemented in the same way as in `RNNCell <#RN **Example** -.. code-block:: cpp +.. code-block:: xml + :force: - - - - - 1 - 4 - 16 - - - 1 - 1 - 128 - - - 1 - - - 1 - 128 - 16 - - - 1 - 128 - 128 - - - 1 - 128 - - - - - 1 - 1 - 4 - 128 - - - 1 - 1 - 128 - - - + + + + + 1 + 4 + 16 + + + 1 + 1 + 128 + + + 1 + + + 1 + 128 + 16 + + + 1 + 128 + 128 + + + 1 + 128 + + + + + 1 + 1 + 4 + 128 + + + 1 + 1 + 128 + + + @endsphinxdirective diff --git a/docs/ops/shape/Reshape_1.md b/docs/ops/shape/Reshape_1.md index dfa5f70764e..8f8671cd64c 100644 --- a/docs/ops/shape/Reshape_1.md +++ b/docs/ops/shape/Reshape_1.md @@ -50,7 +50,8 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the *Example 1: reshape empty tensor* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -76,7 +77,8 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the *Example 2: reshape tensor - preserve first dim, calculate second and fix value for third dim* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -103,7 +105,8 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the *Example 3: reshape tensor - preserve first two dims, fix value for third dim and calculate fourth* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -130,7 +133,8 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the *Example 4: reshape tensor - calculate first dim and preserve second dim* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -155,7 +159,8 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the *Example 5: reshape tensor - preserve first dim and calculate second dim* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/shape/ShapeOf_1.md b/docs/ops/shape/ShapeOf_1.md index 894f173730d..e3889db9d1f 100644 --- a/docs/ops/shape/ShapeOf_1.md +++ b/docs/ops/shape/ShapeOf_1.md @@ -24,7 +24,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/shape/ShapeOf_3.md b/docs/ops/shape/ShapeOf_3.md index 824cc1d66f3..19407e12fbb 100644 --- a/docs/ops/shape/ShapeOf_3.md +++ b/docs/ops/shape/ShapeOf_3.md @@ -38,7 +38,8 @@ **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/shape/Squeeze_1.md b/docs/ops/shape/Squeeze_1.md index 2374e6f2ad2..80a820c878a 100644 --- a/docs/ops/shape/Squeeze_1.md +++ b/docs/ops/shape/Squeeze_1.md @@ -39,7 +39,8 @@ *Example 1: squeeze 4D tensor to a 2D tensor* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -65,7 +66,8 @@ *Example 2: squeeze 1D tensor with 1 element to a 0D tensor (constant)* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/shape/Unsqueeze_1.md b/docs/ops/shape/Unsqueeze_1.md index 3142466c50b..1687fa24980 100644 --- a/docs/ops/shape/Unsqueeze_1.md +++ b/docs/ops/shape/Unsqueeze_1.md @@ -34,7 +34,8 @@ *Example 1: unsqueeze 2D tensor to a 4D tensor* -.. code-block:: cpp +.. code-block:: xml + :force: @@ -61,7 +62,8 @@ *Example 2: unsqueeze 0D tensor (constant) to 1D tensor* -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/signals/DFT_7.md b/docs/ops/signals/DFT_7.md index 6d81260d01c..f8f64fabaf4 100644 --- a/docs/ops/signals/DFT_7.md +++ b/docs/ops/signals/DFT_7.md @@ -77,7 +77,8 @@ Calculations for the generic case of axes and signal sizes are similar. There is no ``signal_size`` input (4D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -102,7 +103,8 @@ There is no ``signal_size`` input (4D input tensor): There is no ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -125,7 +127,8 @@ There is no ``signal_size`` input (3D input tensor): There is ``signal_size`` input (4D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -153,7 +156,8 @@ There is ``signal_size`` input (4D input tensor): There is ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -179,7 +183,8 @@ There is ``signal_size`` input (3D input tensor): There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -209,7 +214,8 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes, the second example): -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/signals/IDFT_7.md b/docs/ops/signals/IDFT_7.md index e4b4c39ad75..830e80c1a0e 100644 --- a/docs/ops/signals/IDFT_7.md +++ b/docs/ops/signals/IDFT_7.md @@ -80,7 +80,8 @@ Calculations for the generic case of axes and signal sizes are similar. There is no ``signal_size`` input (4D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -106,7 +107,8 @@ There is no ``signal_size`` input (4D input tensor): There is no ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -131,7 +133,8 @@ There is no ``signal_size`` input (3D input tensor): There is ``signal_size`` input (4D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -161,7 +164,8 @@ There is ``signal_size`` input (4D input tensor): There is ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -189,7 +193,8 @@ There is ``signal_size`` input (3D input tensor): There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -221,7 +226,8 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes, the second example): -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/signals/IRDFT_9.md b/docs/ops/signals/IRDFT_9.md index d6136f84715..e7305cd3a3c 100644 --- a/docs/ops/signals/IRDFT_9.md +++ b/docs/ops/signals/IRDFT_9.md @@ -96,7 +96,8 @@ Calculations for the generic case of axes and signal sizes are similar. There is no ``signal_size`` input (4D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -121,7 +122,8 @@ There is no ``signal_size`` input (4D input tensor): There is no ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -144,7 +146,8 @@ There is no ``signal_size`` input (3D input tensor): There is ``signal_size`` input (4D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -173,7 +176,8 @@ There is ``signal_size`` input (4D input tensor): There is ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -200,7 +204,8 @@ There is ``signal_size`` input (3D input tensor): There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -230,7 +235,8 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unsorted axes, the second example): -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/signals/RDFT_9.md b/docs/ops/signals/RDFT_9.md index be87f5f555e..2e8d57c56fe 100644 --- a/docs/ops/signals/RDFT_9.md +++ b/docs/ops/signals/RDFT_9.md @@ -72,7 +72,8 @@ Calculations for the generic case of axes and signal sizes are similar. There is no ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -97,7 +98,8 @@ There is no ``signal_size`` input (3D input tensor): There is no ``signal_size`` input (2D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -121,7 +123,8 @@ There is no ``signal_size`` input (2D input tensor): There is ``signal_size`` input (3D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -148,7 +151,8 @@ There is ``signal_size`` input (3D input tensor): There is ``signal_size`` input (2D input tensor): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -174,7 +178,8 @@ There is ``signal_size`` input (2D input tensor): There is ``signal_size`` input (4D input tensor, ``-1`` in ``signal_size``, unsorted axes): -.. code-block:: cpp +.. code-block:: xml + :force: @@ -203,7 +208,8 @@ There is ``signal_size`` input (4D input tensor, ``-1`` in ``signal_size``, unso There is ``signal_size`` input (4D input tensor, ``-1`` in ``signal_size``, unsorted axes, the second example): -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/docs/ops/sort/ExperimentalDetectronTopKROIs_6.md b/docs/ops/sort/ExperimentalDetectronTopKROIs_6.md index 5c0f0e40999..8079b345727 100644 --- a/docs/ops/sort/ExperimentalDetectronTopKROIs_6.md +++ b/docs/ops/sort/ExperimentalDetectronTopKROIs_6.md @@ -44,7 +44,8 @@ output tensor elements. **Example** -.. code-block:: cpp +.. code-block:: xml + :force: diff --git a/samples/c/hello_nv12_input_classification/README.md b/samples/c/hello_nv12_input_classification/README.md index c27625115e6..cdad2c59559 100644 --- a/samples/c/hello_nv12_input_classification/README.md +++ b/samples/c/hello_nv12_input_classification/README.md @@ -64,7 +64,7 @@ To run the sample, you need specify a model and image: The sample accepts an uncompressed image in the NV12 color format. To run the sample, you need to convert your BGR/RGB image to NV12. To do this, you can use one of the widely available tools such as FFmpeg\* or GStreamer\*. The following command shows how to convert an ordinary image into an uncompressed NV12 image using FFmpeg: -.. code-block:: bash +.. code-block:: sh ffmpeg -i cat.jpg -pix_fmt nv12 cat.yuv diff --git a/samples/cpp/benchmark_app/README.md b/samples/cpp/benchmark_app/README.md index 4a2a877de45..76a1697aec4 100644 --- a/samples/cpp/benchmark_app/README.md +++ b/samples/cpp/benchmark_app/README.md @@ -153,7 +153,8 @@ Running the application with the ``-h`` or ``--help`` option yields the followin .. scrollbox:: - .. code-block:: + .. code-block:: sh + :force: [Step 1/11] Parsing and validating input arguments [ INFO ] Parsing input parameters diff --git a/samples/cpp/hello_nv12_input_classification/README.md b/samples/cpp/hello_nv12_input_classification/README.md index 31fb2820650..66640d58411 100644 --- a/samples/cpp/hello_nv12_input_classification/README.md +++ b/samples/cpp/hello_nv12_input_classification/README.md @@ -68,7 +68,7 @@ To run the sample, you need to specify a model and image: The sample accepts an uncompressed image in the NV12 color format. To run the sample, you need to convert your BGR/RGB image to NV12. To do this, you can use one of the widely available tools such as FFmpeg\* or GStreamer\*. The following command shows how to convert an ordinary image into an uncompressed NV12 image using FFmpeg: -.. code-block:: bash +.. code-block:: sh ffmpeg -i cat.jpg -pix_fmt nv12 car.yuv diff --git a/samples/python/speech_sample/README.md b/samples/python/speech_sample/README.md index b530e299b8d..1fa293bed19 100644 --- a/samples/python/speech_sample/README.md +++ b/samples/python/speech_sample/README.md @@ -108,7 +108,7 @@ Running Run the application with the ``-h`` option to see the usage message: -.. code-block:: bash +.. code-block:: sh python speech_sample.py -h diff --git a/tools/pot/docs/BestPractices.md b/tools/pot/docs/BestPractices.md index 79f176ae7d3..ab15576a06d 100644 --- a/tools/pot/docs/BestPractices.md +++ b/tools/pot/docs/BestPractices.md @@ -22,7 +22,8 @@ Improving accuracy after the Default Quantization Parameters of the Default Quantization algorithm with basic settings are presented below: -.. code-block:: python +.. code-block:: py + :force: { "name": "DefaultQuantization", # Optimization algorithm name @@ -57,7 +58,8 @@ Below is a list of best practices that can be applied to improve accuracy withou 3. Some model architectures require a special approach when being quantized. For example, Transformer-based models need to keep some operations in the original precision to preserve accuracy. That is why POT provides a ``model_type`` option to specify the model architecture. Now, only ``"transformer"`` type is available. Use it to quantize Transformer-based models, e.g. BERT. 4. Another important option is a `range_estimator`. It defines how to calculate the minimum and maximum of quantization range for weights and activations. For example, the following ``range_estimator`` for activations can improve the accuracy for Faster R-CNN-based networks: - .. code-block:: python + .. code-block:: py + :force: { "name": "DefaultQuantization", @@ -86,7 +88,8 @@ Accuracy-aware Quantization When the steps above do not lead to the accurate quantized model, you may use the :doc:`Accuracy-aware Quantization ` algorithm which leads to mixed-precision models. A fragment of Accuracy-aware Quantization configuration with default settings is shown below: -.. code-block:: python +.. code-block:: py + :force: { "name": "AccuracyAwareQuantization", diff --git a/tools/pot/docs/DefaultQuantizationUsage.md b/tools/pot/docs/DefaultQuantizationUsage.md index 8be5242b2c7..674d08ba815 100644 --- a/tools/pot/docs/DefaultQuantizationUsage.md +++ b/tools/pot/docs/DefaultQuantizationUsage.md @@ -75,7 +75,8 @@ Select quantization parameters Default Quantization algorithm has mandatory and optional parameters which are defined as a dictionary: -.. code-block:: python +.. code-block:: py + :force: { "name": "DefaultQuantization", @@ -105,7 +106,8 @@ POT API provides methods to load and save model objects from OpenVINO Intermedia An example code below shows a basic quantization workflow: -.. code-block:: python +.. code-block:: py + :force: from openvino.tools.pot import IEEngine from openvino.tools.pot import load_model, save_model diff --git a/tools/pot/docs/SimplifiedMode.md b/tools/pot/docs/SimplifiedMode.md index 56f63bc971c..b7f7f944267 100644 --- a/tools/pot/docs/SimplifiedMode.md +++ b/tools/pot/docs/SimplifiedMode.md @@ -20,7 +20,7 @@ To apply optimization when there is only a model and no data is available. It is Install Datumaro: -.. code-block:: bash +.. code-block:: sh pip install datumaro @@ -29,7 +29,7 @@ Create a synthetic dataset with elements of the specified type and shape, and sa Usage: -.. code-block:: bash +.. code-block:: sh datum generate [-h] -o OUTPUT_DIR -k COUNT --shape SHAPE [SHAPE ...] [-t {image}] [--overwrite] [--model-dir MODEL_PATH] @@ -37,7 +37,7 @@ Usage: Example of generating 300 images with height = 224 and width = 256 and saving them in the ``./dataset`` directory. -.. code-block:: bash +.. code-block:: sh datum generate -o ./dataset -k 300 --shape 224 256 diff --git a/tools/pot/openvino/tools/pot/algorithms/quantization/accuracy_aware/README.md b/tools/pot/openvino/tools/pot/algorithms/quantization/accuracy_aware/README.md index 3d7cc0f9310..e0d733dfd8e 100644 --- a/tools/pot/openvino/tools/pot/algorithms/quantization/accuracy_aware/README.md +++ b/tools/pot/openvino/tools/pot/algorithms/quantization/accuracy_aware/README.md @@ -17,7 +17,7 @@ Since the :doc:`Default Quantization ` document. Below is an example of the definition of Default Quantization method and its parameters: -.. code-block:: python +.. code-block:: py + :force: { "name": "DefaultQuantization", # the name of optimization algorithm