Commit Graph

47 Commits

Author SHA1 Message Date
Gabriele Galiero Casay 371fc7aee4
Enable low precision types in ConvertLike operation reference implementation (#6890)
* Enable low precision types for ConvertLike operation

* Migrate backend unit test suite to template plugin reference tests

* Fix typo in naming convention

* Avoid duplication of template plugin tests execution

* Add file to instantiate TEST_P and avoid test execution duplication
2021-08-06 11:19:16 +03:00
Yury Gaydaychuk 7ab92b5845
[CPU] Adaptive pooling implementation (#6594) 2021-07-29 20:41:24 +03:00
Jozef Daniecki 226cb952ae
Select operation revision (#6483)
* Add visitor test.

* Add Serialization SLT.

* Add Select-1 to summarize.py.

* Remove select from evaluates map.

* Remove few Select cases from manifest.

* Fix style.

* Refactor CoordinateTransform usage for NUMPY.

* Refactor CoordinateTransform usage for PDPD.

* Migrate backend tests to template_plugin.

* Revert "Fix style."

This reverts commit 8298c90104.

* Add more template plugin tests.

* Fixes for PDPD broadcasting.

* Align Select type prop tests with PDPP broadcasting to new
implementation.

* Remove ngraph:: from types in tests.
2021-07-21 08:13:40 +03:00
Patryk Elszkowski 0d9212683f
FakeQuantize - reference implementation refactor (#6478)
* new implementation of FakeQuantize

* move FakeQuantize backend test to fake_quantize.in.cpp

* enable some test for FakeQuantize

* Add support for PDPD broadcasting and some backend tests

* arm plugin expect less attributes in function call

* try to fix arm plugin build

* try to build arm plugin

* start changing backend test

* add check for attributes number in visitor test

* fix backend test after refactoring

* add default parameter value to runtime::reference::fake_quantize

* Revert "add default parameter value to runtime::reference::fake_quantize"

This reverts commit 9d2c00d967.

* add SLT for FakeQuantize

* remove fesetround

* change `v1` namesapce to `v0` in ref impl

* add FakeQuantize-1 to VERIFIED_OP_REFERENCES

* pass immutable reference to test functions
2021-07-19 12:20:54 +03:00
Ivan Tikhonov 697c52abfe
DeformableConv v8: reference implementation (#6514)
* DeformableConv v8:reference implementation

* ngraph codestyle

* update reference iplementation

* Disable tests on GPU

* fix unit tests

* Update DeformConv single layer tests

* fix serialization tests
2021-07-19 06:15:34 +03:00
Luo Cheng da8aeec07b
Reference implementations for MulticlassNms and MatrixNms ops (#6264)
* Reference implementations for MulticlassNms and MatrixNms ops

* fix name conflict

* remove unused var
sort_result_across_batch default set to false

* avoid float overflow

* fix clang check error

* info for mac fail

* change testcase due to unstable sort

* nms add 'normalized' attribute

* fixes: 1. normalized support. 2. sort by score before keep_top_k inside a batch.

* fix sort order in matrix_nms

* fix review comments

* use structure for attributes

* avoid centos gcc fail

* avoid centos gcc failed

* Update evaluates_map.cpp

header file alpha-beta order to avoid possible conflict in future.

* use pointer instead of HostTensorVector

* fix review comments

* fix review comments

* use reference pass parameter

* reuse rect,boxinfo,postprocess

* fix compiling fail

* fix review coments

* use TestCase instead Backend

* fix macos case failed

Co-authored-by: jialipen <cecilia.peng@intel.com>
Co-authored-by: Zhang Yi3 <yi3.zhang@intel.com>
Co-authored-by: yuvrgb <yuvrgb@outlook.com>
2021-07-07 11:19:49 +03:00
Maxim Vafin f1af26dbaf
Add adaptive pool reference implementation (#6317)
* Add adaptive pool reference implementation

* Add forgotten files

* Fix codestyle

* Disable tests

* Add more tests

* Fix build

* Fix comments

* Remove CoordinateTransform usage from AdaptiveAvgPool

* Fix build

* Refactor AdaptiveMaxPool

* Fix codestyle

* Apply review feedback

* Simplify if statement
2021-07-05 08:36:27 +03:00
Vladimir Gavrilov 1d7f81c108
Implement reference nGraph implementation for operation ExperimentalDetectronGenerateProposalsSingleImage (#5881)
* Written header file for the nGraph reference implementation of the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Small fixes.

* Started to write cpp-file for the nGraph reference implementation of the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Written the postprocessing function for the nGraph reference implementation of the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Code style fixes.

* Started to write calculations of the nGraph reference implementation of the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Written the helper function refine_anchors().

* Written the helper function unpack_boxes().

* Small fix.

* Code style fixes.

* Written calculations of the nGraph reference implementation of the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Code style fixes.

* Fixed type of one argument of fill_output_blobs().

* Code style fix.

* Written evaluate() for the operation ExperimentalDetectronGenerateProposalsSingleImage (in evaluates_map.cpp).

* Deleted redundant 'using' for typedef.

* Continued to write tests for ExperimentalDetectronGenerateProposalsSingleImage evaluation in the nGraph reference implementation.

* Fixed the reference implementation of the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Deleted commented code. Code style fixes.

* Code style fix.

* Deleted debug prints in the test for an evaluation of the nGraph operation ExperimentalDetectronGenerateProposalsSingleImage.

* Enabled ONNX Importer test for the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Enabled some test.

* Small fix.

* Now postprocessing of the nGraph reference realization of the operation ExperimentalDetectronGenerateProposalsSingleImage throws exception when input data type is not supported.

* Code style fix.

* Written yet another  test for the nGraph reference implementation of the operation ExperimentalDetectronGenerateProposalsSingleImage.

* Reused ProposalBox type from the reference implementation of the operation Proposal.

* Added check for the attribute post_nms_count in the operation ExperimentalDetectronGenerateProposalsSingleImage evaluation.

* Small fixes.
2021-07-01 14:42:51 +03:00
Szymon Durawa 055a70bdf9
Add output_padding and output_shape into GroupConvolutionBackprop SLTs. (#6302)
* Add output_padding and output_shape into GroupConvolutionBackprop SLTs.

* Add legacy API for arm-plugin dependency.

* Replaced templated input, output and filter with one template.

* Apply correct format.

* Change to use INSTANTIATE_TEST_SUITE_P macro.
2021-06-29 15:34:29 +03:00
Szymon Durawa 978121e91e
Ref implementation transposed convolution revise (#4999) 2021-06-14 13:28:32 +02:00
Roman Kazantsev 5e8d1ccf92
Implement Einsum reference in nGraph interpreter (#5923)
* Implement Einsum reference in nGraph interpreter

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply code-style patch and fix build issues

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix CI build

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix fast build and apply code review feedback

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Add visitor API tests, check for input type and reduce memory consumption

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Apply code style

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Add visitor API tests

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-06-04 11:08:30 +03:00
Vladimir Gavrilov fe8443d9f8
Implement reference nGraph implementation for operations "ExperimentalDetectronDetectionOutput", "ExperimentalDetectronPriorGridGenerator" (#4004)
Implemented reference nGraph implementation for operations "ExperimentalDetectronDetectionOutput" and "ExperimentalDetectronPriorGridGenerator" #43928
2021-05-27 15:17:09 +03:00
Vladimir Gavrilov 91fd2574df
Implement reference nGraph implementation for the operation "ExperimentalDetectronTopKROIs" (#5675)
* Started to write nGraph reference implementation of the operation ExperimentalDetectronTopKROIs.

* Written cpp-file for the nGraph reference implementation of the operation ExperimentalDetectronTopKROIs.

* Code style fixes.

* Started to write evaluate() (in evaluates_map.cpp) for the nGraph operation ExperimentalDetectronsTopKROIs.

* Code style fixes.

* Written evaluate() for ExperimentalDetectronTopKROIs.

* Small fixes.

* Written test for ExperimentalDetectronTopKROIs evaluation.

* Small fix.

* Fixed Apache license header.

* Some changes.

* int64_t was replaced with size_t in the body of ngraph::runtime::reference::experimental_detectron_topk_rois().

* Added more test for evaluation of ExperimentalDetectronTopKROIs.
2021-05-26 17:49:33 +03:00
Jozef Daniecki 9eb7bfdfc0
More unit tests for Convert reference implementation. (#5745)
* Add Convert unit tests to check C++ to LP types convertion.

* Add unit tests to check LP types to C++ ints.

* Disable LP to C++ ints tets in CPU plugin.

* Remove f64 support from Convert evaluate.
2021-05-24 13:05:54 +03:00
Mikhail Treskin 66d98530d9
Handle 3rd optional input in CTCGreedyDecoderSeqLen evaluate (#5669)
* Handle 3rd optional input in CTCGreedyDecoderSeqLen evaluate

* Add test for OP without blank_index input

* Fix default blank_index calculation
2021-05-24 12:24:46 +03:00
Vladimir Gavrilov 6bb5a2c3cb
Add proper signal_size handling for reference nGraph implementation for operations DFT and IDFT (#5610)
* Added tests for 2D DFT when we have signal_size and axes [0, 2].

* Rewritten reference implementation of DFT and IDFT.

* Code style fixes.

* Reverted changes.

* Added debug prints.

* Temporarily commented some functions.

* Reverted changes in (I)DFT reference.

* Added more debug prints (in evaluates_map.cpp, to evaluate() for IDFT).

* Added setting output shape for DFT and IDFT evaluate() in evaluates_map.cpp.

* Added more tests for signal_size case of DFT.

* Written tests for signal_size case of IDFT.

* Deleted debug prints from (I)DFT reference implementation (the file fft.cpp).

* Deleted debug prints from evaluate() for DFT and IDFT.

* Deleted debug prints from tests for DFT.

* Deleted debug prints from IDFT tests.

* Code style fixes.

* Enabled CPU evaluation tests for DFT and IDFT in CPU supported cases.

* Enabled CPU (I)DFT layer tests.

* Copied fix for specialization of function is_float() for (b)float16 from Pertovsky Aleksandr's PR 5654.

* Reverted changes in the function is_float() from ie_precision.h.

* Disabled BF16 CPU FuncTests for (I)DFT.

* Deleted filling 'buffer' by zeros. Simplified the function lengths_except_given_axis.

* Small fix.

* Code style fix.

* Reverted deleting 'std::fill(buffer.begin(), buffer.end(), complex_type{0.0f, 0.0f});'

* Reverted changes in the function lengths_except_given_axis().

* Changes in the function lengths_except_given_axis().

* Small fix.

* Deleted commented code.

* Simplifications in the function lengths_except_given_axis().

* Deleted commented code.

* Enabled BF16 (I)DFT CPU FuncTests.

* Fixed comments before disabled (I)DFT IE_CPU tests.
2021-05-20 17:57:39 +03:00
Irina Efode 9568f8120e
[IE TESTS] Fix Comparation issue in `LayerTestCommon` class (#5624)
* [IE TESTS] Fix comparation in LayerTestUtils

* Fixes

* Small fix

* Int4 fixes

* remove extra

* Fix NMS

* Some fixes for tests

* Add small fix

* [IE TESTS] Remove const folding as a result engine

* Remove extra

* Revert remove constant folding (DSR test) & fix some cases for cpu

* Fix GNA
2021-05-19 13:14:35 +03:00
Katarzyna Mitrus f928f7fc56
DeformablePSROIPoolig reference implementation (#5116)
* Reference implementation init

* Backend tests

* Single layer tests

* Update offset range in layer tests

* Align int types with ng op

* Update spatial bins type

* Type update

* Fix sub bin calculation in mkldnn plugin

* Update summarize py file

* Align result  type

* Refactoring

* Apply review comments

* Add serialize layar tests

* Adjust int comparison

* Adjust code style

* Use clamp reference

* Unify style

* Additional check for negative output dim

* Set tensor output shape in evaluate

* Add visit attributes test

* Small refactor

* Code style (namespace comments)

* Fix CommonTestsUtils::fill_data_roi usage.

This function was generalized in PR #5432 and its siganutre has changed.

* Update licenese header with mention about original authors.

* Replace MIT SPDX full license name with short identifier.

* Fix sub bin calculation in mkldnn plugin

Co-authored-by: jdanieck <jozef.daniecki@intel.com>
2021-05-13 07:44:57 +03:00
Gabriele Galiero Casay 6971303856
Revise BatchNormInference Reference Implementation (#5468)
* Refactor backend tests

* Rewrite reference implementation

 * Align ref impl signature with order of inputs in v5
 * Remove legacy code for training and backprop

* BarchNorminference operation class review

 * Use reference to const in helpers to validate input shapes
 * Refactor type_prop tests to cover v0 and v5

* Add type_prop tests

 * epsilon attribute test with invalid value
 * invalid integer input types

* Add serialization single layer test

* Add attribute visitor test

* Fix arm plugin test failure with dynamic element type

* Remove CoordinateTransform index call

* Add attribute count to visitor test
2021-05-12 13:47:50 +03:00
Tomasz Dołbniak 3e8bc2db69
Handle f32/bf16 conversion in UT (#5330) 2021-04-22 11:59:29 +02:00
Ilya Churaev a672b9c599
Enabled Wall for nGraph (#5270)
* Enabled Wall for nGraph

* Fixed Linux build

* Fixed ONNX Editor and class-memaccess

* Fixed topK

* Fixed some builds

* Fixed nGraph Python API

* Use std::fill instead of cycle

* Wno-unded and deprecation for app python versions
2021-04-22 06:24:03 +03:00
Jozef Daniecki ef70e5187c
Deformable convolution (#4312)
* Add deformable_convolution unit tests

* add 2D unit test

* Add unit-tests for 3D deformable_convolution

* create shared test class for deformable_convolution

* create single layer test for cpu plugin

* create single layer test for serialization

* add deformable_convolution to opset1

* create empty evaluate method

* add group and deformable_group to parameters

* Create impl for generateInput method

* add deformable_val to deformable_conv paramset

* create additional unit-tests

* Remove 3D single layer tests

* Update GenerateInput and SetUp method

* Update parameters values for SLT

* Update GenerateInput method and create Validate method

* Create additional parameters set for cpu plugin SLT

* Create unit-test with padding and add it to disabled

* add interpreter unit tests to manifest

* style-apply

* create file for reference impl

* Update year of copyright and make Validate an override method

* Update parameters names for serialization single layer tests

* Update parameters names for functional single layer tests

* add failing unit tests for interpreter to manifest

* make tests parameters more readable

* style-apply

* Include deformable_convolution inside evaluates_map

* add support for groups parameter for reference impl

* style-apply

* remove DeformableConvolutionParams struct

* fix bug with filter

* fix bug with offset type

* Update interpreter manifest

* impl evalute method

* style-apply

* Update year

* Update test names

* add utils func for deformable convolution operation

* fix filter group count

* add calculation of index of offset

* Update offsets in unit test

* add support for multiple input channels

* add padding tests

* add padding support

* style apply

* update copyright year

* create validation check helper

* Update convolve function name

* update copyright year

* style-apply

* remove integer type from serialize layer tests

* add tests for deformable_groups

* fix bug with group > 1

* style-apply

* add group unit test

* create additional group tests

* fix bug with groups attribute

* Enhance dynamic shape inference of validate and infer types method

* Add type_prop unit tests

* Fix broken op create test in python api

* fix bug with shapes in group tests

* update deformable_convolution method

* add unit test with 2 groups and 2 defromable groups

* Fix code style.

* Update UT manifests with  current test status.

* Refactored backend test: names, removed duplication, add TOODs

* Add missing test cases in 'integral offsets' group.

* Fixed group attribute.

* Update interprer manifest to disable tests with integer offsets.

* Fix style.

* Remove changes in operator class.

* Revert "Enhance dynamic shape inference of validate and infer types method"

This reverts commit 2f9ce2ccd4.

* Revert "Add type_prop unit tests"

This reverts commit 944af98b8c.

* Revert "Fix broken op create test in python api"

This reverts commit 72fbfc2967.

* Fix op class.

* Convert implementation to 2D.

* Simplify implementation.

* Fix centos build.

* Reimplemented offsets handling.

* Fixed integral offsets test cases.

* Fixed deformable group attribute.

* Add bilinear interpolation.

* Refactoring regarding tolerance_bits.

* Fix groups & def_groups test case.

* Add more unit tests for group & defgroup attribute.

* Remove debug code.

* Minor refactoring.

* Add integer types to SLT.

* Revert "Add integer types to SLT."

This reverts commit 2fefe8926d.

* Add tests with real number offsets.

* Refactored bilinear_interpolation().

* Turned on SLT.

Additionally refactored and offset input set to range <0,2>.

* Update headers with short version.

* Fix SLT offests generation with int offsets.

* Add integer types to SLT.

* Fix grup + def_group test case.

* Add ticket to address IE_CPU backend test failures

* Enable real resolution for deformable values

* Add op to list of trusted operations in python script

* Fix comparison of integer expressions of different signedness compilation error

* Add comment with closing namespace and empty lines

Co-authored-by: pszmel <piotr.szmelczynski@intel.com>
Co-authored-by: ggalieroc <gabriele.galiero.casay@intel.com>
2021-04-19 14:12:09 +03:00
Bartek Szmelczynski 6e7a8af2be
Revise squared difference (#5091)
* clean SquaredDifference op from legacy FusedOp operation

* add backend and type_prop tests for squared_difference operation

* apply requested changes

* fix op name

* revert date change

* update squared_difference op info with ngraph RTTI

* change test since squred_diff should be binop
2021-04-16 06:49:27 +03:00
Ilya Churaev 543acb517e
Enabled sign-compare flag for nGraph (#5189)
* Enabled Werror flag for nGraph

* Fixed softmax test

* Fixed ONNX Editor

* Fixed gather_nd

* Fixed i32 compilation
2021-04-15 12:12:51 +03:00
Vladimir Gavrilov f2366f7072
Reference implementation of DFT and IDFT operations (#4938)
* Started to write the header file for (I)DFT reference implementation.

* Continued to write the header file for (I)DFT reference implementation.

* Renamed the header file for the reference implementation of (I)DFT.

* Started to write an implementation file for the reference implementation of (I)DFT.

* Continued to write an implementation file for the reference implementation of (I)DFT.

* Continued to write an implementation file for the reference implementation of (I)DFT.

* Small fix.

* Written copying data from input and copying data to output.

* Code style fixes.

* Small fix.

* Some fixes.

* Some fixes.

* Small fix.

* Written naive version of (I)DFT calculation.

* Some fixes.

* Some fixes.

* Some fixes.

* Some fixes.

* Some fixes.

* Small fixes.

* Written the draft of the reference implementation of (I)DFT.

* Small fix.

* Small fix.

* Code style fixes.

* Added evaluation of (I)DFT to evaluation_map.cpp.

* Small fixes.

* Some fixes.

* Written test for evaluation of 1D DFT.

* Fixed ngraph/test/CMakeLists.txt.

* Disabled DFT evaluation test in CPU, because (I)DFT has not implemented yet in CPU.

* Added debug prints to evaluation test of DFT.

* Added debug prints into evaluate_map.cpp for DFT evaluation.

* Added some debug prints into FFT calculation.

* Added more debug prints.

* Added more debug prints.

* Added more debug prints.

* Added more debug prints.

* Added more debug prints.

* Small fix.

* Added more debug prints.

* Added more debug prints.

* Small change.

* Some fixes.

* Small fix.

* Some changes.

* Added more tests.

* Added test for IDFT 1D calculation.

* Some fixes.

* Added more debug prints.

* Small fix.

* Small fix.

* Some fixes.

* Some fix.

* Small fix.

* Added tests for 2D case of IDFT.

* Some fixes.

* Written tests for 3D case of DFT.

* Some fixes.

* Small fix.

* Added test for 3D case of IDFT.

* Some fixes.

* Deleted debug prints from tests for IDFT.

* Deleted debug prints from tests for DFT.

* Deleted debug prints from the reference implementation of (I)DFT.

* Code style fixes.

* Deleted debug prints from evaluates_map.cpp.

* Written the header file for the base class of DFT and IDFT operations.

* Written an implementation of the base class of DFT and IDFT.

* Now nGraph IDFT operation class is a derived class of FFTBase.

* Now the nGraph operation DFT is a derived class of FFTBase.

* Added assert for axes in (I)DFT reference.

* Small refactoring.

* Deleted commented code.

* Small refactoring.

* Small fix.

* Initialization of calculations of the reference implementation of (I)DFT was moved in the separate function.

* Small fix.

* Code style fix.

* Small fix.

* Now evaluate() of (I)DFT uses canonicalize_axes() from the reference implementation.

* Code style fix.

* Deleted commented code.

* Added tests for i32 axes of DFT.

* Added test for i32 axes of 2D DFT.

* Added i32 axes case to test for 3D DFT.

* Added test for i32 axes in tests for IDFT.

* Written signal_size case test for 1D DFT.

* Small fix.

* Written test for signal_size case for 2D DFT.

* Added test for bfloat16 input data of 1D DFT.

* Small fix.

* Small fix.

* Small fix.

* Some fixes.

* Some fix.

* Added bfloat16 input tests for 2D DFT.

* Some fixes.

* Written tests for bfloat16 input of 3D DFT.

* Some fixes.

* Some fixes.

* Added tests for bfloat16 input of 1D IDFT.

* Some fixes.

* Added tests for bfloat16 input of 2D IDFT.

* Added test for bfloat16 input of 3D IDFT.

* Small fix.

* Some fixes.

* Added tests for float16 input of 1D DFT.

* Small fix.

* Written tests for float16 input of 2D and 3D DFT.

* Small fix.

* Some fixes.

* Some fixes.

* Written tests for float16 inputs of 1D, 2D, 3D IDFT.

* Some fixes.

* Some fixes.

* Some fixes.

* Some fixes.

* Deleted redundant include.

* Some fixes.

* Added tests of 1D and 2D DFT for the case when some axes lengths are powers of 2.

* Added tests for 3D DFT and 1D, 2D, 3D IDFT in the case when lengths of some axes are powers of 2.

* Small fix.

* Added some comments.

* Added some comments.
2021-04-14 10:52:57 +03:00
Bartek Szmelczynski 4120344d11
Revise mod (#5060)
* clean the FusedOp from mod operation

* add backend and type_prop tests for mod operator

* convert taking autobrodcast to match binary elementwise arithmetic ops

* add type_prop/mod.cpp to CMakeLists.txt

* fix style

* fix style v2

* remove evaluate method and add backend test for negative numbers

* add copyright for type_prop/mod.cpp
2021-04-03 19:07:01 +03:00
Anastasia Popova 440d2abd1f
Roll reference implementation (#4947)
* Added reference implementation for Roll operation.

* Small corrections.

* Removed duplicate test disabling.

* Changed implementation using manual data manipulation.

* Removed unnecessary function.

* Corrected tests, added converting axes and shift to int64.
2021-04-02 14:12:37 +03:00
Alexey Suhov a748c26fee
Align copyright notice in cpp and cmake source files (CVS-51320) (#4950) 2021-03-25 02:40:09 +03:00
Ivan Novoselov ec5df02dac
Revise OneHot operation reference implementation (#4330)
* Auto benchmarks for evaluate(...) and extra unit tests.

* Test suite for manual i/o examination.

* Template on input type. Constant folding tests the 'count_ops_of_type' issue.

* Multidim manual tests

* NgOp&Ref: Unit tests Ok. NB evaluates_map

* Stable. Negative indices as if larger than depth. Benchmarks removed.

* Added Serialization SLT

* I/O shapes consistency checks

* Consistency checks in evaluate(). Removed the ref from evaluates_map.

* removed excessive #include from evaluates_map

* Code style
2021-03-16 11:28:30 +03:00
Gabriele Galiero Casay bd949c6baf
BinaryConvolution Reference Implementation (#4278)
* Add BinaryConvolution unit tests.

* Changed types to u1.

* Add BIN precision handling in TestCase class.

* Refactored validate and infer types to enhance dynamic shape inference

* Add type_prop test to cover invalid op cases and dynamic shapes

* Fix style

* Disable check for float type of data batch input

* Add type_prop test for incompatible input channels in inputs

* Disable backend unit tests

* Fix style

* Add reference implementation

* Add backend tests

* Add single layer tests

* Add check for float element type of batch data input

* Refactor backend test cases to compare with regular convolution

* Add serialization tests

* Clean up

* Add 1D and 3D tests into op_eval

* Changes in reference implementation to improve readability

* Add ticket information for todo tasks

* Fix implementation misbehavior for filter channels

* Add backend unit tests to cover strides, dilations, padding, channels and batches

* Add end of line into files

* Change name of type_prop unit tests

* Simplified lambda to get spatial dimensions of filters

* Add comment to support filters input as Parameter

* Add namespace details for BinaryConvolution utility functions

* Address review comments

Co-authored-by: jdanieck <jozef.daniecki@intel.com>
2021-03-09 22:58:25 +03:00
Evgeny Lazarev 99f94ca09c
Adding v7::Gelu operation (#4497)
* Added support for Gelu-6 to the MO

* Adding Gelu-6 to ngraph and python API + some tests

* Fixed typo in the Gelu approximation mode

* Fixed Gelu-6 reference implementation for Tanh mode

* Added transformation to downgrade v6::Gelu to v2::Gelu

* Added specification for the Gelu-6

* Code style fixes

* The Gelu-6 operation specification update

* Fixed compilation issue in reference implementation for Gelu

* Fix compilation issues for some OSs

* Code style fix

* One more cpplint issue fix

* Fixed Gelu6 reference implementation compilation on Windows.

* Code style fix

* Fixed various ngraph unit tests

* Code style check

* Reverted Gelu-2 to be fused op

* Fixed Gelu6 downgrade transformation

* Added unit test for Gelu6Downgrade transformation

* Update copyright year

* Updated copyright year

* Replaced tab characters with 4 spaces in IR reader tests

* Code style fixes

* Added default value for GeluApproximation mode for Gelu-6 op

* Fixed code style for Gelu-6

* Changed order of parameters for the Gelu evaluate to potentially avoid backward compatibility issues with ARM plugin

* Fixed code style

* Introduced opset7. Moved Gelu6 to opset7

* Fixed non-updated transformation

* Fixed opset version in ngraph Python API for Gelu operation

* Fixed typo in the opset number in the documentation

* Reverted some changes related to Gelu6

* Updated MO to produce Gelu7

* Updated unit tests for Gelu

* Updated Gelu7 specification

* Changed gelu reference implementation. Added opset7 to Python packages

* Updated Python API tests for Gelu operation

* Code style fix

* Marked get_approximation_mode function as const

* Added missing "const" qualifier

* Fixed code style issues in tests

* Added extractor for MxNet operation Gelu

* Spelling issues fix

* Updated MxNet supported symbols

* Added NGRAPH_OP_SCOPE for Gelu7 validate_and_infer_types

* Fixed a typo in the comment
2021-03-09 22:45:45 +03:00
Jozef Daniecki 0acd153a6c
Group convolution backprop data (#4113)
* GroupConvolutionBackpropData: Added backend unit tests

* GroupConvolutionBackpropData: Refactor SLT and added tests for 1D

* GroupConvolutionBackpropData: Added Serialization tests

* GroupConvolutionBackpropData: Added GroupConvolutionBackpropData reference implementation

* GroupConvolutionBackpropData specification refactoring.

* GroupConvolutionBackpropData: Added validation node checks for the op

* GroupConvolutionBackpropData: Copyright year fixed

* GroupConvolutionBackpropData: Enhanced output shape inference with dynamic shapes

* GroupConvolutionBackpropData: Remove redefinition of helper variables

* Spec refactoring: add ticks to types and layouts.

* Minor refactoring.

* GroupConvolutionBackpropData: Moved backend tests from GroupConvolution to corresponding file

* GroupConvolutionBackpropData: Improved output shape inference for fully dynamic inputs

* GroupConvolutionBackpropData: Clean up type_prop tests

* Fix banner in GroupConvolution shared test class.

Co-authored-by: ggalieroc <gabriele.galiero.casay@intel.com>
2021-02-08 13:38:14 +03:00
Bartosz Lesniewski 210ad8194a
Proposal reference implementation (#3924)
* Reference implementation for Proposal, enable CPU SLT

* code style fix

* add type prop test for invalid anchor count

* add unit test

* fix shapes in attribute test

* temp workaround- disable maring end of boxes list

* Disable CPU smoke test- spec misalignment

* code style fixes

* add some details to the specification

* disable myriadx proposal slt

* review changes, using usigned int and size_t

* improve proposal op shape inference to cover dynamic too, add unit test coverage

* remove unused variable in test body

* remove batch size in tests where its not used

* add post nms topn initialization in tests where it was missing

* review comments

* style fix

* style fix 2

* add tests, remove unused variables, change shape inference checks

* style fix

* add input tensors type checks and test coverage

* align input type in attribute and ngraphreader tests to match specification

* fix wrong dimension in error message

* proposalv4 ref impl

* enable single layer and unit tests for proposalv4 ref impl

* align output termination with cpu, enable cpu slt

* custom slt compares to detect less-than-predicted number of boxes

* custom slt compares to detect less-than-predicted number of boxes

* Clarify output termination in spec

* review comments

* smaller input data for unit tests

* add check for batch_dim being static

* disable gpu slt for proposal

* test data style fix

* test data style fix 2

* add type section to specification

* shape inference improvement

* multiply expected 1st dim in tests by post_nms_topn

* add checks and testcases for dynamic ranks

* indentation, review comments

* reduce code redundancy in ref implementation

* remove comment

* Fix typo in proposal1 spec

* Fix typo in proposal4 spec
2021-02-08 07:09:54 +03:00
Jozef Daniecki 4b1efeb858
Group convolution (#3995)
* GroupConvolution SLT style refactoring.

* Add GroupConvolution 1D SLT.

* Add GroupConvolution Serialization SLT.

* Add GroupConvolution ref impl to evaluates_map.

* Add GroupConvolution ref impl.

* Fix compilation on master.

* GroupConvolution specification update.

* Readability refactoring.

* Specification refactoring.

* Added 'output' section in GropuConvolution spec.
2021-02-03 16:07:01 +03:00
Jozef Daniecki c1b0b03750
Convolution (#3922)
* Move Convolution and ConvolutionBackpropData ref impls into separate files.

* Add convolution unit tests.

* New convolution reference implementation.

* Remove unused convolution ref impl argument.

* Fix style.

* Revert "Remove unused convolution ref impl argument."

This reverts commit 739065d0d0.

* WA for arm-plugin: additional include with ConvolutionBackpropData.

* Style format in Convolution SLT CPU instantiation.

* Add 1D Convolution SLT CPU tests.

* Add Convolution Serialization SLT.

* Update source banners with 2021 date.

* Specification review.

* Readability improvement in padding detection.

* Refactoring regarding Tensor usage.

* Iteration over tensor slices made more readable.

* Code refactored to use only one convolution implementation.

3D convolution is used to compute also in 1D & 2D case (parameters,
inputs and filters shapes are adjusted accordingly).

* Removed Tensor abstraction.

* Name unnamed namespace as convolution_details.

* Refactoring: replaced std::next + negative index with std::prev.

* Specification refactoring.

* Revert "Name unnamed namespace as convolution_details."

This reverts commit cea526ec49.

* Added new convolution() overload.

* Fix legacy convolution() overload (needed for kmb-plugin).

* Reduced number of template type arguments in convolution ref impl.

* Added 'output' section in Convolution spec.

* Remove floating round type configuration.
2021-02-02 11:05:39 +03:00
Bartosz Sledz 247606baf6
Add support for nonconstant optional NMS-5 inputs (#3640) 2021-01-26 14:41:28 +01:00
iliya mironov c083e7fb63
Imironov/ref ngraph ctc gready decoder (#3867)
* Add ctc gready decoder sec len op to ngraph

* Remove some comments

* Add second constructor

* Fix code style

* Fix code style

* Add unit tests

* Add tests to cmake

* Fix according to review

* Fix code style

* fix

* Change input layoyt

* Fix code style

* Add unit tests

* Add 3 input tensor check

* Update shell impl

* Fix code style

* Fix code style

* Add doxy gen

* Fix code style

* Update doxigen

* Update constructor description

* Fix code style

* Refactoring code

* fix code style

* Optimize op constructor

* Add macros. Optimize code for validate_and_infer_types

* Refactoring code

* Fix code style

* Fix code style

* Fix check blanck_index shape

* Fix code style

* Add ref impl

* Fix unit test for dynemic case

* Fix code style

* Fix copyryting

* reverse changes

* Update copyrite

* Add ref implemintation

* rollback

* Fix code style

* Fix code style

* Fix

* Add unit tests

* Refactoring ref impl

* Refactoring code style

* Fix code style

* Fix code style

* fix unit tests

* Refactoring code

* Refactoring code

* Fix code style

* Refactoring unit tests

* Fix style

* Fix style
2021-01-25 08:19:03 +03:00
Ilya Lavrenov 9cfe909e1e
Unused variables (#3963)
* Added -Wused-variable flag

* Fixes for clang compiler

* Removed wrong -Wno-error from protobuf compilation

* More fixes
2021-01-22 17:41:15 +03:00
Maxim Vafin 71253153ac
Add MVN-6 reference implementation and tests (#3896)
* Add MVN-6 reference implementation and tests

* Return old version reference

* Apply feedback

* Fix build
2021-01-21 21:08:32 +03:00
Gabriele Galiero Casay e026d54ed2
Develop ConvertLike Reference Implementation (#3857)
* ConvertLike: Develop reference implementation

* ConvertLike: Enable single layer tests for GPU plugin

* ConvertLike: Enable bf16 precision for evaluate method

* ConvertLike: Add unit tests

* ConvertLike: Add dynamic shape test case

* ConvertLike: Remove unnecessary ngraph namespace and using declaration for v1::ConvertLike

* ConvertLike: Simplified reference::convert by using std::enable_if
2021-01-21 08:31:10 +03:00
Gabriele Galiero Casay a555908858
Develop Bucketize Reference Implementation (#3693)
* Bucketize: Revise op class and add type_prop unit tests

* Bucketize: Develop reference implementation

* Bucketize: Add unit tests

* Bucketize: Add single layer test and cpu instantiation

* Bucketize: Add unit test with empty buckets for INTERPRETER

* Bucketize: Typo in buckets element type check

* Bucketize: Add custom generated inputs in single layer test class

* Bucketize: Use random_device to generate seed for data blob

* Bucketize: Remove unsupported f64 precision

* Bucketize: Add function description

* Bucketize: Remove randomness of inputs generation by using static seed

* Bucketize: Support different precisions for data and bucket inputs

* Bucketize: Refactor type_prop tests and improve backend unit test coverage
2021-01-15 17:51:58 +03:00
Tomasz Dołbniak 303c549791
nGraph copyright update for 2021 (#3832) 2021-01-13 16:43:04 +03:00
Pavel Esir d9bd59c7a0
Evaluate, ngraph_reader check and Python nGraph API for GatherElements (#3624)
* add GatherElements evaluate to interpreter backend

* Finally successfully run on backend

* debugged non-typical cases

* added ngraph_reader tests for GatherElements

* added Python API for GatherElements

* apply_style

* corrected python api tests

* applied comments

* style-apply

* finally corrected nGraph Python API for GatherElements

* minor corrections

* style-apply

* replaced quotes

* added blank line

* corrected evaluate and disabled unit-tests for not yet supported plugins

* style-apply

* applied comments: negative tests added and additional checks in evaluate

* added bound check for axis in evaluate

* style-apply

* apply review comments

* fast correct evaluate for GatherElements

* style-apply

* revert changes in interpreter unit_test.manifest for Gather

* 🚀 optimized general solution; added separate calculation for 2D

* 🚀 applied comments

* style-apply
2021-01-11 19:52:47 +03:00
Mateusz Tabaka 47485646bb
Revise DetectionOutput reference implementation (#3448)
* Revice DetectionOutput reference implementation

Ticket: 37433

* fix test_create_op

* fix test_dyn_attributes

* apply code format

* fix crash on Windows when variance_encoded_in_target == 1

* add more checks for DetectionOutput inputs

* Fix single layer tests

* apply code format

* fix ssd_vgg16_300 inference with batch size > 1

* update types in docs

* fix crash on windows

* apply code style

* fix python tests

* fix setting output type

* change False to false and True to true in docs

* Allow prior boxes to have different type than box logits

Some models work that way

* simplify output shape calculation

* fixes to docs
2020-12-16 11:02:12 +03:00
Ilya Churaev 9ea24c5b33
Removed reference implementations from tests (#3541) 2020-12-10 12:00:48 +03:00
Mateusz Tabaka 305f005605
Add reference implementation for PSROIPooling operator (#3245)
* Add reference implementation for PSROIPooling operator

* fix test_roi_pooling

* use std::roundf

* remove unnecessary copies in single layer tets

* Fixes after review

* fixes after review

* use element::Type_t instead of element::

* apply code format

* add PSROIPooling to evaluates_map

* apply code format
2020-12-08 06:35:52 +03:00
Mikhail Treskin 6467c64000
Remove opset0 support and undesired passes from Interpreter backend (#1469)
* Move evaluate() interface from some OPs to Interpreter

* commit

* Move shuffle channels reference to OP's evaluate

* Add some operations missed in evaluate_node

* Fix select references invocation from evaluate_node()

* Activation refs (#2)

* HardSigmoid

* Elu

* Selu

* Gelu

* Move to test runtime

* Rollback donwgrade passes delition

* Initial batch to space refs

* Return opset1_upgrade

* WIP: Add space to batch evaluate

* Fix space to batch

* add evaluates function in evaluates_map (#4)

* Add space to batch evaluate

* Fix crop in batch to space references

* Remove vectors reallocation in evaluates for b2s and s2b

* .

* Add SpaceToDepth evaluate

* Add depth to space evaluate

* Remove code duplication depth to space evaluate

* Fix some failed layer tests

* Ngraph test (#3)

* Remove some v0 ops & fix some tests

* Fixes BatchNorm

* Next

* dd

* s

* Add dot & replace slice refs

* d

* dkj

* Review fixes part 1

* Fixes. Part 2

* Fixes. Part 3

* Enable cells refs in evaluate map

* Fix some failed layer tests

* Some more fixes

* Fix code style (#6)

* Tests (#7)

* PriorBox

* Mod

* NormilizeL2

* Update prior_box.hpp

* Fix one hot ref call

* .

* Select (#8)

* Select

* Fix code style

* Fix select messages

* ReverseSeq (#9)

* ReverseSeq

* Select

* ExtractImagePatches, Seqence

* Fix Code Style

* remove extra

* Remove etra line@

* Add fake quantize reference

* Align convolution layer tests instantiations with updated definition

* Disabled some failed LPT tests

* Disabled some failed LPT tests

* Remove undesired changes

* Update unit-test manifests + some code cleanup

* Fix code style (#10)

* Normalize L2 refs support (from PR #2327)

* Fix code style

* Apply review comments. Part 1 (#11)

* Apply first part of review comments

* Update onnx_import.in.cpp

* Remove redundant reshape from shuffle_channels evaluate

* Decompose GroupConvolution

* [IE Ngraph] Fix some operation inheritance  (#13)

* [IE TESTS] Depth2Space

* Space2Depth

* ShuffleChannels

* Fix ode style

* Fix code style

* [IE NGraph] Remove decompose op (#14)

* .

* Fix loosing control dependency in replace_node

* Fix loosing control dependency in replace_node

* Fix code style

* Fix FQ references build on windows

* Fix code style

* Apply comments (#15)

* [Ie Ngraph] Remove using v1::Add

* [Ie Ngraph] Remove using v1::Mutliply

* [Ie Ngraph] Remove using v1::Subtract

* [Ie Ngraph] Remove using v1::Divide

* [Ie Ngraph] Remove using v1::Equal

* [Ie Ngraph] Remove using v1::Greater

* [Ie Ngraph] Remove using v1::Greater_eq

* [Ie Ngraph] Remove using v1::Less

* [Ie Ngraph] Remove using v1::LessEq

* [Ie Ngraph] Remove using operator+

* [Ie Ngraph] Remove using operator/

* [Ie Ngraph] Remove using operator*

* [Ie Ngraph] Remove using operator-

* Fix code style

* Ci (#16)

* Fix CentOS compilation

* Revert ngraph::op::vo::Multiply removing due to OpenCV

* Android fix (#17)

* fix failures

* Fix code style

* Add (#18)

* Android fix

* Add

* Add in opset1 upgrade pass

* Add in opset1 upgrade pass

* Remove v0::Add, Reverted removing v0::Multiply (#19)

* Remove overloaded math operators from PyNgraph

* Remove overloaded math operators from PyNgraph

* Fix gna tests (#20)

* Fix gna tests

* Squashed commit of the following:

commit 565b504c1c
Author: Alexander Zhogov <alexander.zhogov@intel.com>
Date:   Tue Oct 13 13:27:34 2020 +0300

    GitHub CI: Add files_size.yml (#2570)

    * GitHub CI: Add files_size.yml

    * Update job name

commit ab0fb29853
Author: Vladislav Vinogradov <vlad.vinogradov@intel.com>
Date:   Tue Oct 13 11:37:30 2020 +0300

    [IE][BUILD] Fix C5208 warning under Windows (#2628)

    * C++ feature in C `typedef struct` code.
    * The warning can be promoted to error in dependent projects.

    C5208: unnamed class used in typedef name cannot declare members other than
    non-static data members, member enumerations, or member classes

commit 15a338e89b
Author: helmutg <helmut@subdivi.de>
Date:   Mon Oct 12 22:24:24 2020 +0200

    add build option USE_SYSTEM_PUGIXML (#2502)

    It allows skipping inference-engine/thirdparty/pugixml and using the
    system copy instead.

    Thanks to @Osse for helping understand cmake scoping rules.

    Co-authored-by: Helmut Grohne <helmut.grohne@intenta.de>

commit 7ac8cd8586
Author: Alexander Zhogov <alexander.zhogov@intel.com>
Date:   Mon Oct 12 19:23:00 2020 +0300

    Azure CI: Fix nGraph ONNX

commit 3a2e33962c
Author: Alexander Zhogov <alexander.zhogov@intel.com>
Date:   Mon Oct 12 19:20:28 2020 +0300

    Azure CI: Disable steps in nGraph ONNX

commit 5835974fad
Author: azhogov <alexander.zhogov@intel.com>
Date:   Mon Oct 12 18:46:14 2020 +0300

    Azure CI: Add linux_ngraph_onnx.yml

* LRN Reference (#21)

* Disable failed tests on ia32

* Remove redundant broadcast from MVN ref

* Fix missed GatherND in opset_int_tbl + code style

* Remove one extra temporary buffer from MVN ref

* Merge master (#22)

* Leaky relu transformation refactor (#2640)

* Refactored LeakyRelu transformation

* Added unit test for LeakyRelu transformation + removed duplicate test function valued_const

* nGraph implementation of NMS-5 (without `evaluate()`) (#2651)

* Written nGraph NMS-5 without evaluate().

* Used NGRAPH_RTTI_DECLARATION.

* setupvars.sh: Updated setting pyenv error to warning. (#2663)

* Fix itt build (#2662)

* Loop-5 operation specification (#2291)

The Loop-5 operation specification

* Time tests improvements (#2642)

* Remove extra functions from run_timetest.py

* Add `log.debug` of raw and aggregated statistics in run_timetest.py

* Implement storing of models locally for test_timetest.py

* Fixed CVS-35316 (#2072)

* Extend MO for operation GatherND (#2540)

* Extend MO for operation GatherND

* Update documentation

* Rename GatherNd.py to gathernd.py

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Add hsigmoid op to ngraph (#2647)

* [IE CLDNN] Fixes for GatherTree and ReverseSequence  (#2660)

* ReorgYolo reference implementation (#2384)

* Align ReorgYolo to the spec (vector strides -> int stride)

* ReorgYolo ref impl

* ReorgYolo evaluate method

* ReorgYolo tests

* Tests update

* Style apply

* Add some coments

* Code refactor

* Comment update

* Style apply

* Build fix, mark evaluate as override

* Revert "Align ReorgYolo to the spec (vector strides -> int stride)"

* Use int_executable instead of evaluate

* Use char* instead of templates

* Code refactor

* Comment update

* Code review comment

* Add constructor aligned with spec

* Update shape validation

* Update attributes tests

* Add type_prop tests

* Update backend tests

* Add single layer tests

* Update the spec

* Remove wrong transformation test

* Add ReorgYolo to evaluates_map

* code style

Co-authored-by: Evgeny Lazarev <evgeny.lazarev@intel.com>
Co-authored-by: Vladimir Gavrilov <vladimir.gavrilov@intel.com>
Co-authored-by: Artyom Anokhov <artyom.anokhov@intel.com>
Co-authored-by: Andrey Somsikov <andrey.somsikov@intel.com>
Co-authored-by: Vitaliy Urusovskij <vitaliy.urusovskij@intel.com>
Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>
Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
Co-authored-by: iliya mironov <iliya.mironov@intel.com>
Co-authored-by: Vladimir Paramuzov <vladimir.paramuzov@intel.com>
Co-authored-by: Katarzyna Mitrus <katarzyna.mitrus@intel.com>

* RegionYolo

* Apply review comments

* Merge remote-tracking branch 'upstream/master' into update_evaluates

# Conflicts:
#	ngraph/core/src/op/mvn.cpp
#	ngraph/test/backend/fused_op.in.cpp
#	ngraph/test/runtime/ie/unit_test.manifest
#	ngraph/test/runtime/interpreter/int_executable.hpp
#	ngraph/test/runtime/interpreter/opset_int_tbl.hpp
#	ngraph/test/runtime/interpreter/unit_test.manifest
#	ngraph/test/runtime/opset0_tbl.hpp

* Apply code style

* Apply comments

* Apply code style

* Fix RegionYolo evaluate redefinition

* Removed defines from evaluates map

* Apply code style

* Fix MVN ref

* rename select reference argument

* Fix code style

* Fix Fake Quantize references calculation (#24)

* Fix MVN ref

* Fix MVN & adding NMS

* Fix TI

* Temporary relax comparison threshold for FQ SLT

* Fix GPU LPT Tests

* Add explicit rounding mode seetting in FQ references

* Apply code style

* Rollback op_is test deletion

* Apply code style

* Fix merge conflict resolving issues

* Apply code style

Co-authored-by: Irina Efode <irina.efode@intel.com>
Co-authored-by: Anton Zaytsev <anton.zaytsev@intel.com>
Co-authored-by: Evgeny Lazarev <evgeny.lazarev@intel.com>
Co-authored-by: Vladimir Gavrilov <vladimir.gavrilov@intel.com>
Co-authored-by: Artyom Anokhov <artyom.anokhov@intel.com>
Co-authored-by: Andrey Somsikov <andrey.somsikov@intel.com>
Co-authored-by: Vitaliy Urusovskij <vitaliy.urusovskij@intel.com>
Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>
Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
Co-authored-by: iliya mironov <iliya.mironov@intel.com>
Co-authored-by: Vladimir Paramuzov <vladimir.paramuzov@intel.com>
Co-authored-by: Katarzyna Mitrus <katarzyna.mitrus@intel.com>
2020-12-03 12:36:34 +03:00