Commit Graph

270 Commits

Author SHA1 Message Date
Evgeny Lazarev
60059f2c75 Fixed dead lock in telemetry (#4873)
* Fixed dead lock in telemetry

* Refactored TelemetrySender.send function

* Refactored send function implementation to avoid deadlocks

* Unit tests for telemetry sender function

* Added legal header
2021-03-19 14:59:45 +03:00
Mikhail Ryzhov
0100810dd6 Added mo.py to wheel packages (#4731) 2021-03-12 15:57:12 +03:00
Anastasia Popova
a53524a554 Fixed bug in assign elimination transformation. (#4644) 2021-03-09 14:58:12 +03:00
Roman Kazantsev
ff73955354 Add workaround for control edges to support TF 2.4 RNN (#4634)
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-03-05 16:41:36 +03:00
Evgeny Lazarev
3cd5da0797 Fixed transformation to pull constants into Loop body (cherry-pick of PR 4591) (#4607)
* Cherry-pick of PR 4591

* Fixed typo

* Moved a check into the parameter_unchanged_after_iteration function
2021-03-04 17:56:54 +03:00
Pavel Esir
29612f15e3 Fix StridedSlice replacer order and input permutation when strides are not specified (#4545) 2021-03-03 11:16:56 +03:00
Anastasia Popova
9f5fad16e7 Added check that new name is unique. (#4516)
* Added check that new name is unique..

* Added unique names test.

* Fixed unique name check.

* Fixed bug.

* Reformat code.

* Fixed bug, extended tests.

* Uncomment tests.
2021-03-02 17:26:55 +03:00
Evgeny Lazarev
f88638006c Reverted changes in the Pad transformations caused a regression in the POT (#4552) 2021-03-02 16:00:11 +03:00
Svetlana Dolinina
42c1c65454 fix calculation of memoryoffset shape (#4533)
* fix calculation of memoryoffset shape in 2 cases: after normalization layer (shape can be read from InputDim in loader) and after affincecomponent layer (shape saved in out-size based on weights shape)

* improve comments
2021-03-02 14:35:22 +03:00
Vladimir Gavrilov
473c944e6e Failed MO shape infer after SplitConcatPairToInterpolate transformation, when Concat has more than one producer (#4502)
* Fixes in the MO transformation SplitConcatPairToInterpolate.

* Small fix.

* Small fix.

* Added test for the case when inputs of Concat are two Splits.

* Added docstring to the function get_concat_after_split.

* Some fixes.

* Small fix.
2021-03-02 14:09:42 +03:00
Anton Chetverikov
7770701fe8 Update pooling extender for 3D cases (#4504)
* Update pooling extender for 3d cases

* Update error message
2021-03-01 18:54:47 +03:00
Anton Chetverikov
96875ef411 Revert non-forward-compatible changes for PriorBox & PriorBoxClustered operations (#4501)
* Add conversion from bool to int

* Update specification

* fix codestyle

* Fix conversion error

* Resolve review comments
2021-03-01 13:50:33 +03:00
Gleb Kazantaev
1bdccb41df Telemetry for IE dependency warnings (#4431)
* Initial telemetry for IE dependency warnings

* Unified MO/IE version extraction; updated telemetry messages to use simplified versions

* Update telemetry

* Renamings; improvements; comments

* Turn On telemetry

* Added tests

* Added versions_mismatch flag

* plarform -> system
2021-03-01 13:30:40 +03:00
Evgeny Lazarev
e065cf554a Fixed L2NormFusing transformation (#4526)
* Fixed L2NormFusing transformastion

* Refactor L2NormFusing transformation
2021-03-01 12:13:25 +03:00
Evgeny Lazarev
62fb80aa43 Fixed conversion of the TF OD API 2.0 SSD models (#4529) 2021-03-01 11:42:41 +03:00
Vladimir Gavrilov
b15a70caf7 Corrections in MO to fix performance drop in Interpolate-4 when mode=linear instead of linear_onnx (#4488)
* Written the transformation that replaces 'linear' mode of Interpolate-4 by 'linear_onnx' mode, when the input tensor rank is equal to 4.

* Fixed BOM-file.

* Fixed copyright year.

* Added message into assert.

* Small fix.
2021-02-27 08:49:47 +03:00
Svetlana Dolinina
a1ef9498a3 fix unintended shape change (#4510) 2021-02-26 18:29:29 +03:00
Yegor Kruglov
f7b6ad710f update output ports count depending on opset version (#4439) 2021-02-26 09:18:03 +03:00
iliya mironov
799f34238e Imironov/fix ctc greedy decoder pattern matcher (#4441)
* Fix puttern matcher condition

* Refactoring pattern matcher

* Update unit tests
2021-02-25 09:42:43 +03:00
Pavel Esir
162bdde251 [MO][TF] Fixed TFSliceToSlice conversion error on Win (#4367)
* [MO][TF] Fixed TFSliceToSlice conversion error on Win, replaced int32_max with ShapeOf, minor correction in comments

* review apply: added create_op_with_const_inputs

* review apply: renamed variables, updated typehints for int64_array, float_array, float32_array

* renamed to correct_ends

* returned back check_op_attrs=True
2021-02-24 16:34:43 +03:00
Evgeny Lazarev
5fa1e2140e Temporary disable telemetry (#4449) 2021-02-24 13:27:10 +03:00
Svetlana Dolinina
5ee00a989f add string constants '0'/'1' to bool normalizer (#4402)
* add string constants '0'/'1' to bool normalizer

* fix bug
2021-02-24 13:17:32 +03:00
Evgeny Lazarev
7420bb6cb0 Fix pad op with int input (#4438)
* Added operation ConvertLike to the MO

* Fixed transformations with Pad which insert Const with pad value of incorrect type

* Added constant folding to ConvertLike operation

* Fixed unit tests for Pad transformations to include ConverLike operations

* Update copyright year

* nGraph code style fix

* Added OV_ITT_SCOPED_TASK for ConvertLike constant folding
2021-02-24 09:56:36 +03:00
Maxim Vafin
bf6b061709 Fix MVN in MO (#4311)
* Fix MVN in MO

* Apply feedback and add test

* Remove unneeded import

* Apply review feedback

* Apply review feedback

* Fix issue with class name
2021-02-20 11:11:51 +03:00
Yegor Kruglov
7e3289cc58 added condition for removing input ports (#4396) 2021-02-20 10:26:37 +03:00
Anton Chetverikov
8c79d4134f Update Convert extender (#4409)
* Update Convert extender

* Update copyright year
2021-02-19 20:50:46 +03:00
Gleb Kazantaev
5d647e6fab Add IE Python Dependency To MO (#4151)
* Added script that check IE existance

* Updated install_prerequisites.sh to check and insall IE python dependency

* Execute MOC transformation pipeline in subprocess

* Updated path to offline_transformations.py

* Updated IE dependency search; added libs search support

* Updated install_prerequisites.bat to check IE dependency

* Print warning if MO and IE versions do not match

* Set env before subprocess run

* Add mean and meta info to serialized IR

* Fix pylin import issue

* Update BOM file; added intel headers

* use default serialization; code style fix

* Codestyle

* Added subprocess timeout

* Check e2e status

* Update install_prerequisites.sh logic

* Update MO version to be generated even without cmake execution

* Update install_prereq to extract release version from python

* Simplify pyhton code

* Reduce memory consumtion to its original value

* Added OV find and search logic for windows batch script

* Remove model reading to avoid excess memory consumtption

* IMproved logging messages; simplified code

* Improved warnign message incase when MO and IE versions mismatch

* Fix test import

* Check IE bindings in the beginnig of MO pipeline

* Changed warning message; added RelWithDebInfo path

* Recomendation to build IE from source

* Resolve PR comments

* Apply review comments; Added CheckAPI pass

* Added path to IE local libs

* ModelOptimizer -> Model Optimizer (+IE)

* OpenVINO -> OpenVINO (TM) Toolkit

* Updated install_prerequisites.bat with new logic

* Move offline_transformations.py to back folder; improve warning mesages experience

* Update install_prerequisites.bat

* Move back some unnecessary changes

* Fix BOM

* Disable import errors for pylint

* Fixed grammar in messages

* pylint disable import error

* Final grammar fixes in bat and sh files
2021-02-19 14:13:20 +03:00
Pavel Esir
7dca134031 [MO] [TF] Added TF broadcast_to extractor (#4376)
* Added TF broadcast_to extractor

* updated Supported_Frameworks_Layers.md

* corrected name

* corrected op name in Supported_Frameworks_Layers.md

* added a space after BroadcastTo in Supported_Frameworks_Layers.md
2021-02-19 11:44:11 +03:00
Vladimir Gavrilov
2b732ec1d7 Incorrect type of 'scales' input of the operation Interpolate-4 in some cases (#4375)
* Commit.

* Fixed element type of scales input in the MO transformation UpsampleToResample.

* Fixes in the transformation TFSliceToSliceReplacer.

* Fixes in tests.

* Small fixes.

* Reverted fixes in TFSliceToSliceReplacer.

* Small fix.

* Added tests for fractional scales in the transformation UpsampleToResample.
2021-02-19 10:52:41 +03:00
Anton Chetverikov
2c4afd8cd4 Tensor names support in MO IR Reader (#4194)
* Added attributes save modes

* Added tensor names to IR

* Reformat code

* Add support for tensor names in MO IR Reader

* Unit tests and code refactoring

* Fixed error

* Code refactoring

* Code refactoring

* Code refactoring

* Error fixed

* Error fixed

* Bug fixed

* Bug fixed

* Additional unit tests and comments

* Small update

* Update fake infer function

* Update names restoring

* optimize imports

* Add support for old-style constants and for commas in reader

* Added dest mode in Fuse Mul

* Update default values

* Fix missed debug info in some specific cases

* Fix a lot of issues with missedand wrong names provoding

* Resolve review comments

* Update test IR's

* Refactor and simplify code

* More simplification

* Remove unneccessary changes

* model-optimizer/mo/utils/ir_reader/layer_to_class_test.py

* Add separate tests for names restoring

* Update copyright year

* Apply review comments

Co-authored-by: Anastasia Popova <anastasia.popova@intel.com>
2021-02-18 10:38:04 +03:00
iliya mironov
f670b7cb3a Add CTCGreedyDecoder mo support (#4009)
* Add CTCGreedyDecoder mo support

* Update copiright

* Update bom file

* Add transformation

* Fix code style

* Fix according to review

* Add CTCGreedyDecoder v6 to ConvertPrecision

* Hot fix

* Add replasment for ctc_greedy_decoder

* Fix test

* Fix

* Update ie transform

* Draft ctc lost replaser

* Add ctcloss replaser

* Update

* Refactoring code

* Update transformation

* Update decoder

* Remove comments

* Convert seq mask from int to float

* Fix unit test

* Add dynamic tests

* Refactoring code

* Fix py code style

* update style

* Disable ctcgreedydecoder transform for mkldnn plugin

* Add some comments

* Add transfor code comments

* Enable transform from differend plagins

* Fix mo

* fix tests

* Fix comment

* Fix convert precition

* Update comment

* Fix prcition

* Refactoring according to reviw

* Add ir reder extender

* Rename transformation

* Update bom file

* Fix mo replacer

* Fix tests

* Move transform to decomp

* Add check blank_index

* Rafactoring ctcloss

* Change dinemic rank check

* Fix ctclos extractor

* Remove comment

* Fix code style

* Refactoring pattern matcher for transformation CTCGreedyDecoder

* Disavle transform for vpu

* Refactoring according to review

* Refactoring code

* Disable transformation for cldnn

* Remove unused code

* Reverse transfomation

* Fix code style

* Hot fix transform

* Fix unit tests

* Update transform

* Enable transform in common pipline

* Fix names replasments for mo transformations

* Hot fix

* Fix
2021-02-17 14:38:51 +03:00
Evgeny Lazarev
f8f60b2d83 Stick requirement version of astroid to be 2.4.2. Also fixed pylint issue with astroid==2.5 (#4365) 2021-02-16 21:34:51 +03:00
Pavel Esir
22169a05b9 [MO] StridedSlice improvements (#4139)
* fix ss

* successfully converted

* successfully run moved infer and normalizer unit-tests

* successfully rewritten StridedSlice infer unittests

* int64 array

* Successfully converter crash-when-loading, xj_feauture and toy nets (cherry-picked maxpoolV4 and tf_broadcast_ext)

* successfully moved PermuteAttrs to general mechanism

* successfully converted xj_feauture and crash when loading with the new rewritten SS infer

* fixed get_shape_from_slice and moved to common utils

* fixed extending masks and some other

* some refactoring

* fixed extending masks in extractor, fixed licence year and some other code clearing

* corrected a couple of unittests

* fox permute for 5 rank slice and 4 rank inputs/

* WIP

* Added comments

* fixed StridedSlice in ProposalMutation.py

* rechecked shape_infer unittests added some new cases

* added shape_infer unit-tests after StridedSliceNormalizer pass and Permute unit-tests

* corrected unittests

* Applied review comments

* general permutations for inputs implemented, corrected ellipsis unrolling when shrink_axis is at the beginning, some other corrections

* removed code duplication in infer and normalizer, moved 'slices' attr normalizing to StridedSliceNormalizer.py

* removed some code duplication and other minor improvements

* Added tests

* minor corrections

* wider range of unittests added (froze the number)

* review comments applied

* enabled skipped unit-test

* comment corrections

* applied review comments: changed op -> type, added some asserts, corrected comments and other minor corrections

* sorted inputs, updated Supported_Frameworks_Layers.md, some minor
2021-02-16 11:48:49 +03:00
Anastasia Popova
eeb7835128 Result rename operation (#4242)
* Added result rename operation

* Optimize imports

* Added ResultRename to package_BOM

* ResultRename moved to the end of back phase, code refactoring

* Revert incorrect changes

* Optimize imports

* Added comments and optimized imports.
2021-02-12 22:44:21 +03:00
Evgeny Lazarev
bdc0dcfcf5 Fixed bom file and updated unit test (#4309) 2021-02-12 14:47:18 +03:00
Maxim Vafin
d91b9fd8da Fix backward compatibility of MVN in MO (#4289) 2021-02-11 22:36:31 +03:00
Evgenya Stepyreva
08ac8d9af9 Reverse input channels fusion (#4276)
* Side fix found while working on Windows machine.

* Fix for non-fused Reverse Input Channels subgraph
2021-02-11 14:27:08 +03:00
iliya mironov
0341edcfa0 Update mxnet version (#4081) 2021-02-10 17:19:06 +03:00
Evgeny Lazarev
66f4c69b90 Telemetry sender and MO instrumentation (#3804)
* Draft implementation of the telemetry sender utility

* Examples of sending telemetry from the MO

* More statistic about the model.

* Intentional broken file to fail Mask-RCNN ONNX model conversion

* Added joined list of ops used

* Added requests to the requrements file and update BOM to include necessary files related to telemetry

* Send telemetry alwasys

* Refactored usage of GUID usage in the telemetry

* Enabled sending telemetry always

* Simplified function "TelemetryBackend.send"

* Use other approach to send information about session to GA

* Added automatic registration of the telemetry backends and allow to choose it during the telemetry class instantiation

* Added "requests" as a requirement. Wrapped usage of requests module to not crash the app

* Added timeout for sending data to GA. Increased the queue size to 1000

* Finalize Telemetry class implementation

* Do not fail MO if non-critical component is not installed and updated Telemetry GA with the default property

* Added sending version to a separate event

* Use default TID to send the data

* Set lower bound for the requests module which does not contain vulnerabilities

Co-authored-by: Evgeny Lazarev <elazarev.nnov@gmail.com>
2021-02-10 10:51:31 +03:00
Maxim Vafin
deca4fc443 Fix wrong attributes for Pad (#4216) 2021-02-09 14:11:39 +03:00
Anton Chetverikov
c1a606d507 Update L2NormToNorm transformation (#4154)
* Removechanges added by mistake

* Update transformation

* Refactor tests, add more cases

* Rename variable

* Refactor and rename transformation

* Update tests, add more cases
2021-02-09 14:07:08 +03:00
Dmitry Navalny
14d3310b32 [MO] pip packaging (#3123)
* [MO] pip packaging

* Use subprocess

* Remove MANIFEST.in

* Fix comments

* Fix requirements.txt duplication

* Add license
2021-02-09 10:47:14 +03:00
Roman Kazantsev
636f5c44b0 [MO] Support TF2 Keras ConvLSTM2D operation (#4197)
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2021-02-09 10:11:38 +03:00
Ivan Tikhonov
6789c158fd New versions of Assign/ReadValue ops (#4055)
* new versions of assign/read value, squashed commits

* Assign/ReadValue base classes, code style

* update ie_ir_parser and conversion

* low latency transformation update to support Loop op

* ngraph code style

* fix build, refactoring

* fix unit tests

* fix unit tests again

* fix unit tests

* fix code style

* update comments

* ngraph codestyle

* fix low latency tests

* fix failed unit tests

* fix incorrect version of submodule

* fix review remarks

* ngraph code style

* fix ngraph tests

* fix low latency unit tests
2021-02-09 09:50:55 +03:00
Pavel Esir
7eac2a1452 [MO][TF] Add Tensorflow Pooling V2 (#3911)
* [MO][TF] Add Tensorflow Pooling V2

* corrected extractor

* applied review comments

* remove empty line in PoolV2ToAttributedPool.py

* MaxPool attributes extraction fix
2021-02-09 09:46:32 +03:00
Maxim Vafin
a157cc2a55 Support ":" in node name for mean/scale application (#4082)
* Support ":" in node name for mean/scale application

* Apply review feedback
2021-02-08 16:51:53 +03:00
Ryan Loney
56b6e1065b Update install_prerequisites.bat (#4205)
* Update install_prerequisites.bat

Removed warning language to show that you can optionally install protobuf to speed up model conversion. It should not be a warning.

* Update install_prerequisites.bat
2021-02-07 10:13:44 +03:00
Anastasia Popova
cfc3b563a5 Tensor names in IR (#4089)
* Added attributes save modes

* Added tensor names to IR

* Reformat code

* Unit tests and code refactoring

* Fixed error

* Code refactoring

* Code refactoring

* Code refactoring

* Error fixed

* Error fixed

* Bug fixed

* Bug fixed

* Additional unit tests and comments

* Added dest mode in Fuse Mul
2021-02-06 09:31:47 +03:00
Vladimir Gavrilov
c1136cd7b0 Completely transition of MO to Interpolate-4 (#970)
* Refactored infer function and function supported_attrs for the layer Interpolate.

* Small change.

* Deleted unneeded checks in transformations ResizeToInterpolate2D and ResizeToInterpolate3D.

* Small fix in the extractor of ONNX Resize.

* Now the extractor of TF ResizeBilinear generates Interpolate-1 again, because 'axis' in final version of Interpolate-4 specification is an input but is not attribute.

* Now the extractor of TF ResizeNearest generates Interpolate-1 again, because 'axis' in final version of Interpolate-4 specification is an input but is not attribute.

* Added static method get_axis into class Interpolate.

* Refactored class CanBeFused in the transformation InterpolateSequenceToInterpolate.

* Fixed transformation InterpolateSequenceToInterpolate according to the last version of the specification of Interpolate-4.

* Started to write support of Interpolate-4 in the transformation InterpolateWithConcat.

* Added support for Interpolate-4 into the transformation InterpolateWithConcat.

* Added support for Interpolate-4 into the transformation InterpolateConcat.

* Added support for Interpolate-4 into the transformation InterpolateReshapeWA.

* Added support for Interpolate-4 into the transformation InterpolateTranspose.

* Started to add test for opset4 case of the transformation InterpolateSequenceToInterpolate.

* Added test for InterpolateSequenceToInterpolate (test_2d_interpolate_sequence_1_opset4_case).

* Added test for InterpolateSequenceToInterpolate (test_2d_interpolate_sequence_4_opset4_case).

* Added another test for InterpolateSequenceToInterpolate (test_2d_interpolate_sequence_5_opset4_case).

* Added another test for InterpolateSequenceToInterpolate (test_3d_interpolate_sequence_1_opset4_case).

* Finished addition of tests for opset4 case of InterpolateSequenceToInterpolate.

* Small change.

* Now opset is only opset1 or opset4 in the transformation InterpolateTranspose.

* Small fixes in transformations ResizeToInterpolate2D and ResizeToInterpolate3D.

* Deleted reading of unused ONNX attributes.

* Fixed docstring of the transformation InterpolateV1ToInterpolateV4.

* Added node name in assert about axes input.

* Fixes in the definition of the operation ONNXResize11.

* Now Interpolate-4 cannot have 'extension' as opset.

* Now the transformation InterpolateV1ToInterpolateV4 uses find_and_replace_pattern but not replace_sub_graph.

* Fixed tests for transformations InterpolateReshapeWA and InterpolateConcat.

* Fixed some tests.

* Rewritten operation Interpolate-4 class according to new variant of documentation.

* Some fixes in ONNXResize11 operation class.

* Now the transformation ONNXResize11ToInterpolate generates Interpolate-4 with 4 inputs.

* Now the transformation UpsampleToResample generates Interpolate-4 with 4 inputs.

* Now the transformation NearestNeighborUpsampling generates Interpolate-4 with 4 inputs.

* Now transformations ResizeToInterpolate2D and ResizeToInterpolate3D generate Interpolate-4 with 4 inputs.

* Now the transformation SplitConcatPairToInterpolate generates Interpolate-4 with 4 inputs.

* Now the transformation UnsqueezeTileReshapeBlockToInterpolate generates Interpolate-4 with 4 inputs.

* Now the transformation InterpolateV1ToInterpolateV4 generates Interpolate-4 with 4 inputs.

* Some fixes.

* Fixed the transformation InterpolateSequenceToInterpolate according to new variant of Interpolate-4 specification.

* Fixed typos.

* Added shape_calculation_mode to supported_attrs.

* Small fixes.

* Added operation ONNXResize10 and the transformation ONNXResize10ToInterpolate4.

* Fixed function correct_scales_using_dst_shape.

* Some fixes in InterpolateSequenceToInterpolate.

* Fixed bug in the method __call__ of the class CanBeFused: now self.accumulated_axes is correctly cleared in all cases.

* Small change.

* Fixed tests for the transformation SplitConcatPairToInterpolate.

* Now transformations InterpolateWithConcat, InterpolateReshapeWA, InterpolateConcat support Interpolate-4.

* Fixed the transformation InterpolateTranspose for the case of Interpolate-4.

* Written the back transformation InterpolateV4AxesCorrection to convert 'axes' input of Interpolate-4 from NHWC to NCHW layout.

* Added PermuteInput in Interpolate-4 infer.

* Fixed typos.

* Deleted the transformation InterpolateAxesCorrection.

* Now Interpolate-4 permutes axis, not shape in input port 3.

* Small fix.

* Some fix.

* Fixed bug in the transformation UpsampleToResample.

* Added some debug prints.

* Added more debug prints.

* Now ONNX Upsample-9 operation is read as ONNXResize10.

* Small fix.

* Small fixes.

* Fixed tests for the transformation SplitConcatPairToInterpolate.

* Deleted debug prints.

* Deleted some debug prints.

* Fixes in the transformation UnsqueezeTileReshapeBlockToInterpolate and its tests.

* Small fix in the transformation InterpolateSequenceToInterpolate.

* Started to write nGraph transformation to convert Interpolate-1 to Interpolate-4.

* Deleted redundant files.

* Small fixes.

* Small fix.

* Written draft of the transformation Interpolate-1 -> Interpolate-4.

* Small fix.

* Now ONNX Importer reads Resize-10 as Interpolate-4.

* Fixes in the test onnx_model_resize10_import_only.

* Small fix in the test for the conversion Interpolate-1 -> Interpolate-4.

* Small fixes.

* Fixed NGraphReaderTests for Interpolate.

* Some fixes.

* Deleted class for Resample operation.

* Fix in the transformation NearestNeighborUpsampling: fixed precision of the input 'scales' of generated Interpolate-4.

* Fixed typo.

* Now the TF operations ResizeBilinear is readed as internal MO operation TFResizeBilinear. This internal operation is converted into Interpolate-4.

* Small fix in BOM-file.

* Added checks of existence of attributes of TF  ResizeBilinear operation.

* Small fixes in the conversion of the internal MO operation  TFResizeBilinear to Interpolate-4.

* Small fixes.

* Small fixes.

* Now the transformation ONNXResize10ToInterpolateV4 calculates sizes input as input_shape * (scales + epsilon).

* Added the internal MO operation TFResizeNearestNeighbor.

* Fixes in the transformation SplitConcatPairToInterpolate and its tests.

* Fixes in the transformation UnsqueezeTileReshapeBlockToInterpolate and its tests.

* Written the transformation that converts the internal operation TFResizeNearestNeighbor into Interpolate-4.

* Now MO reads the TF operation ResizeNearestNeighbor as the internal MO operation TFResizeNearestNeighbor.

* Small fix.

* Now the specification of Interpolate-4 clarifies that the mode linear_onnx supports only 2D or 4D input tensors.

* Small fix.

* Some fixes.

* Moved the transformation ONNXResize10ToInterpolateV4 to the front stage.

* Deleted infer function and function supported_attrs for ONNXResize10 operation.

* Deleted supported_attrs() for TFResizeBilinear and TFResizeNearestNeighbor.

* Some fixes.

* Fixes in the shape infer function of the nGraph operation Interpolate-4. Now 'axes' input can be non-constant.  In the such case, all elements of the output shape are Dimension::dynamic().

* Deleted corner cases processing in transformations TFResizeBilinearToInterpolateV4 and TFResizeNearestNeighborToInterpolateV4.

* Rewritten the function replace_resize_bilinear.

* Written inner MO operation TFResize that covers TF operations ResizeBilinear and ResizeNearestNeighbor.

* Now TF operations ResizeBilinear and ResizeNearestNeighbor are read as an internal operation TFResize in MO. Transformations TFResizeNearestNeighborToInterpolateV4 and TFResizeBilinearToInterpolateV4 are fused into one transformation TFResizeToInterpolateV4.

* Some changes in the shape infer function of nGraph op Interpolate-4.

* Small fix.

* Some changes.

* The transformation TFResizeToInterpolateV4 is moved to the front stage.

* Deleted redundant assert.

* Deleted transformations ResizeToInterpolate2D and ResizeToInterpolate3D.

* Some renaming.

* Small change.

* Deleted .copy() in the shape infer function of the internal operation TFResize.

* Small fix.

* Small fixes.

* Added comment about the case when the input 'axes' of Interpolate-4 is non-constant.

* Written test for Interpolate-4 shape infer, for the case when the input 'axes' is non-constant and shape_calculation_mode = scales.

* Some fixes.

* Small fixes.

* Small fix.

* Added yet another test for the case of non-constant 'axes' input of Interpolate-4 (when shape_calculation_mode = sizes).

* Added some comment.

* Small fix.

* Reverted changes for InterpolateWithConcat.

* Added type checks for all inputs of nGraph operation Interpolate-4.

* Added u32 and u64 to supported element types of sizes and axes inputs of nGraph operation Interpolate-4.

* Fixed some functional tests.

* Some changes.

* Added helper function float32_array.

* Now the MO transformation InterpolateV1ToInterpolate preserves names of layers.

* Small fix.

* Small fix.

* Reverted some change.

* Small fixes.

* Small fix.

* Small fix.

* Small fix.

* Small fix.

* Reverted changes in the nGraph reader tests for Interpolate-1.

* Some revert.

* Fixed some copyright year.
2021-02-05 19:20:26 +03:00
Maxim Vafin
08a527602f Extend LayerNorm pattern to support onnx bert (#4137)
* Extend LayerNorm pattern to support onnx bert

* Fix test

* Fix test
2021-02-05 14:26:24 +03:00