Commit Graph

750 Commits

Author SHA1 Message Date
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
Elizaveta Lobanova
4393525313 [GNA] 1D convolution support for native NCHW models (#4067) 2021-02-05 14:55:11 +03:00
Alexey Varyzgin
1bd7b37419 [CPU] BF16 Deconvolution support (#4048)
* disable and cleanup interp and resample that is covered by interpolate

* [BF16] Deconvolution was enabled

* Deconvolution tests were added

* Copyright year was fixed

* Friendly name usage for tests

* Test inherited from CPUTestsBase

* Fusing tests were added

* oneDNN was updated

* Gemm and 1x1 were added with tests

* Number of channels not aligned on vector length was done for blocked cases

* DW deconvolution case was added with tests

* oneDNN changes for BF16 deconvolutions were squashed

Co-authored-by: chenhuwa <chenhu.wang@intel.com>
2021-02-04 22:19:01 +03:00
Anton Pankratv
945da5ff4f Removed template from base (#4045)
Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2021-02-04 17:43:20 +03:00
Ilya Lavrenov
367cacd2f2 CVS-43973: added HWC layout (#4147)
* CVS-43973: added HWC layout

* Added test
2021-02-04 15:16:31 +03:00
Jozef Daniecki
2d979accab Added BIN precision convertion to ngraph's u1. (#4160)
* Added BIN precision convertion to ngraph's u1.

* Add test to check if serialization works with BIN precision.
2021-02-04 14:41:54 +03:00
Anton Pankratv
54c889f876 Implemented base cancelation implementation (#3805) 2021-02-04 11:19:44 +03:00
Mingyu Kim
04760cb59a [IE CLDNN] Added ScatterElementsUpdate op support (#4105) 2021-02-04 11:16:27 +03:00
Ilya Lavrenov
956c6dd35f Extracted toolchain to build with static runtime from OneCore toolchain (#3045)
* Static runtime

* Fixed cldnn compilation with static runtime

* Added separate toolchain for static runtime

* Added toolchain itself
2021-02-04 11:08:30 +03:00
Chenhu Wang
db84033aa8 [CPU] Introduced Load/Store emitters (#3567)
- Created emitters for jitted load and store and apply to MVN node
- MVN template function removed
- Optimized tiles processing in MVN node implementation
2021-02-04 10:21:26 +03:00
Bartek Szmelczynski
18a65b5330 Serialization dynamic layer bug (#3982)
* remove if statement which checks if there is no dynamic shape

* remove reshaping for genericIE operation

* back to the previous version with reshape

* remove blank space

* add plugin_api to cmake in order to use generic_ie.hpp in serialize file

* add SLT for serialization for NonMaxSupperesion operator

* revert the removal of if check for dynamism

* remove the left over from CMakeLists

* fix CmakeLists removal fail

* remove redundant parenthesis

* add test which failed in the first place and fixes to it

* fix wrong spaces
2021-02-04 07:21:37 +03:00
Svetlana Dolinina
dc1b605b7f Ngraph: add methods for removing parameters from Function (#3854)
* added methods for parameters

* added tests

* remove parameter from low latency

* Revert "remove parameter from low latency"

This reverts commit 86a91ddcb0.

* comment added

* fix style

* review fix

* extended comments

* style fixes

* review fixes

* test fix

* added full pipeline test
2021-02-04 06:59:06 +03:00
Ilya Churaev
748780e392 Supports tensor names with delimiter (#4085)
* Supports tensor names with delimiter

* Fixed comments

* Allow to use different delimiters
2021-02-04 06:38:05 +03:00
Anton Pankratv
0a63b9214a Used std::string as API paramters (#4050) 2021-02-03 19:21:39 +03:00
Ilya Lavrenov
75ed35836f Properly enabled ia32 build (#4145)
* Properly enabled ia32 build

* Fixed OpenCV_DIR env check
2021-02-03 17:26:50 +03:00
Edward Shogulin
f57f1fafc7 [LPT] Q/DQ support integration (#3575)
* [ MO ] New INT weights form

	Ticket #34096

	FQ = Quantize -> Dequantize =
	= FQ` -> Convert(int8) -> Convert(src_dtype) -> FQ =
	= Constant(int8) -> Convert(src_dtype) -> FQ =
	= Constant(int8) -> Convert(src_dtype) -> Subtract(zero_point) -> Multiply(scale)

* [LPT] Q/DQ representation support

Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com>
2021-02-03 17:05:34 +03:00
Nikolay Shchegolev
8d7c9de090 [CPU] Enable MVN-6 operation. (#3400) 2021-02-03 16:49:37 +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
Patryk Elszkowski
3ad1360f5f Compare function - compare attributes - unit test (#4092)
* Enable node attributes comparing in SLT

* Add values of compared values to error message

* Switch from op version to set

* Test for Constant node

* Compare clamp min max attribute tests

* try to fix CentOS build

* use HasSubstr matcher from gMock

* add more tests

* Add DummyConstan op to check if validation handle different types

* use new Function comparison API

* Add test for unsupported type

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2021-02-03 15:24:25 +03:00
Ilya Lavrenov
be772c58bb Fixed "Reverse input channels" case for common Plugin API (#4142)
* Added preprocessing for GetBlob

* Fixed preprocessing tests

* Added more test cases

* Skipped tests on GPU
2021-02-03 14:21:33 +03:00
Kamil Magierski
9ff8e262ee Dynamic Batch Test (#3936)
* Dynamic Batch Test

Whitespace fixes

style fixes

Include path fix

whiteline fix

Review comments implementation

* MacOS build fix

* Move dynamic batch test to configuration_tests

* change test namespace
2021-02-03 13:16:48 +03:00
Nikolay Shchegolev
4d9a030ff2 [CPU] Enable CTCGreedyDecoderSeqLen. (#3890) 2021-02-03 12:36:41 +03:00
Vladislav Golubev
d681582251 [LPT] MatMul: 3D quantization support (#3391)
* [LPT] MatMul: supported 3D quantization
[LPT] MatMul with constant: propagate subtract
[LPT] LayerTransformation:added canBeTransformedSpecialDimension for transformations that support not only per-channel/per-tensor quantization
[LPT] plugin tests: added 3D test-cases

* reshape_fully_connected naming fix

* [LPT] NetworkHelper: replaced onWeights with isConstantPath
[LPT] MatMulTransformation cpuFuncTests tests: rtPrecision check

* [LPT] constant folding FQ on weights if child operations aren't supported
[LPT] convolution with incorrect weights tests refactoring
[LPT] fq on weights with unsupported operations tests
2021-02-03 09:11:06 +03:00
Mateusz Tabaka
da4c50f4ff Fuse x * HSigmoid(x) to HSwish(x) (#4121)
* Fuse x * HSigmoid(x) to HSwish(x)

* use pattern_value_map

* switch to opset6

* get rid of dynamic_pointer_cast
2021-02-02 22:23:44 +03:00
Maxim Vafin
0b3ff5edc2 Add MO support for MVN-6 (#3772)
* Add MO support for MVN-6

* Apply review feedback

* Apply review feedback

* Enable MVN-6 decomposition

* Fix shape_infer issue

* Fix MVN6 decomposition

* Fix build

* Fix tests

* Small fix

* Add MVN-6 reader test

* Apply feedback

* Apply review feedback

* Fix onnx test failure
2021-02-02 17:45:56 +03:00
Ilya Churaev
6a0bc80137 Fixed CNNNetwork iterator for some corner cases with Memory (#4084)
* Fixed CNNNetwork iterator for some corner cases with Memory

* Fixed tests
2021-02-02 16:58:51 +03:00
Patryk Elszkowski
fe4c48e432 Compare function: change API to a class (#4077)
Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2021-02-02 15:43:55 +03:00
Maksim Kutakov
f0398212f8 [CPU] Split layer nspc -> ncsp special case put back. (#3839) 2021-02-02 15:40:50 +03:00
Taylor Yeonbok Lee
38fab0265d [IE CLDNN] Fixed scatter update op & reshape kernel (#4106) 2021-02-02 14:57:32 +03:00
Evgenya Stepyreva
f1ffe4f9fd nGraph value propagation (#3368)
* partial value and shape propagation

* TopK k propagation

* stylish commit

* style again

* Precalc Folding and broadcasting fix

* style

* Self review

* forgetting the unused values

* deleting unused variables

* Review

* self review

* disaster mistake fixed

* tests corrected

* mod to be inferred while creation

* LPT test fix

* tests fixes

* fix

* tests

* dynamic backend fix

* comments

* disable propagation
2021-02-02 12:03:56 +03:00
Mateusz Tabaka
4e601eb315 Move Extension tests from ieFuncTests to cpuFuncTests (#3927)
* Move Extension tests from ieFuncTests to cpuFuncTests

* Move extension directory up
2021-02-02 11:55:14 +03:00
Maxim Andronov
c56f3cd170 [CPU] Fix NormalizeL2 + Multiply (#4047) 2021-02-02 11:43:35 +03:00
Mateusz Tabaka
ecb6d8604e Add Add->Clamp->Div->Mul to HSwish fusion (#4027)
* Add Add->Clamp->Div->Mul to HSwish fusion

* use opset4 NS instead of op::v0, don't copy constants RT info

* use opset4 in tests
2021-02-02 11:12:21 +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
Aleksandr Pertovsky
d754e9b311 [CPU] CumSum tensors with rank >= 6 support. (#3859) 2021-02-02 10:45:52 +03:00
Maxim Andronov
537179b235 [CPU] FakeQuantize decomposition (#3741) 2021-02-02 09:37:02 +03:00
Chenhu Wang
4570550636 [CPU] Interpolate node: 5d support for onnx_linear mode (#3471) 2021-02-01 19:25:57 +03:00
Yury Gaydaychuk
7500bbd3b1 [CPU] ROIPooling with 1x1 pooled shape in bilinear mode fixed (#4020) 2021-01-29 15:09:39 +03:00
Patryk Elszkowski
450f01280a [compare_function] compare ops attributes (#3966)
* [compare_function] compare ops attributes value by value

* Storage cleanup

* Add comparison for:
- SubGraphOpInputDescription
- SubGraphOpOutputDescription
- SpecialBodyPorts

* cleanup

* Report error on unhandled types

* Change comparison of floating-point to general approach

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2021-01-29 12:30:57 +03:00
Ilya Churaev
2ebae7cf30 Introduce the Broker API to map original framework names to OV (#3800)
* Added tests

* Fixed tests

* Added tests to check addOutput method

* Added support of port names in the IR

* Update copyrights

* Deprecate tensor name

* Fixed comments

* Enabled functional tests for GPU, GNA and Myriad

* Fixed get_tensor().get_names()

* Added unit test to check tensor names

* Fixed code style

* Skip add output test for GNA

* Added serialization support

* Added PythonAPI

* Fixed tests

* Fixed tests

* Fixed typo

* Try to disable GNA test

* Fixed tests

* Removed unused variables

* Fixed tests

* Update documentation

* Fixed comment
2021-01-29 06:28:31 +03:00
Yury Gaydaychuk
b0f5a339e1 Proposal test uses special run() method to check exception throwing (#4062)
* proposal test uses special run() method to check exception throwing

* validate() removed from run()
2021-01-28 21:16:13 +03:00
Yury Gaydaychuk
a1422a49d7 [CPU] PSROIPooling node enhancements (#3851)
- bf support for PSROIPooling
- nhwc, blocking formats support
- code refactor & performance improvements
- cpu specific tests
2021-01-28 11:55:54 +03:00
Edward Shogulin
46f0775c09 [LPT] Add NormalizeDequantization function in NetworkHelper (#3458)
* [LPT] Add NormalizeDequantization function in NetworkHelper.

* [LPT] Handling subtract constant index in makeDequantization

* [LPT] Extend Add and Multiply transformations with normalizeDequantization.

* [LPT] Add/Subtract simplify normalizeDequantization call

* [LPT] normalizeDequantization: usage replace_node instead of copy assignment

* [LPT] Update lpt paths

* [LPT] normalizeDequantization completion + refactoring

Co-authored-by: Aleksandr Pertovsky <aleksandr.pertovsky@intel.com>
2021-01-28 11:30:52 +03:00
Aleksandr Pertovsky
885a493336 [LPT] Handle empty dequantization in MultiplyToGroupConvolution (#3818)
Add const
2021-01-28 11:23:30 +03:00
Elizaveta Lobanova
65053df07c [GNA] Convolution without --disable_nhwc_to_nchw option for TF models. (#3918) 2021-01-27 17:15:34 +03:00
Vladislav Golubev
9371393311 [IE CLDNN] StridedSliceTransformation removed from GPU plugin (#4016) 2021-01-26 18:44:29 +03:00
Gorokhov Dmitriy
d58b4c65c8 [CPU] Plugin migration on oneDNN (v1.6) (#3725) 2021-01-26 16:31:10 +03:00
Szymon Durawa
0791987491 Add Loop serialization, SLT and regular test. (#3980)
* Add Loop serialization, SLT and regular test.

* Remove loop test from SerializationTensorIteratorTest, add bin for test loop xml.

* Remove metadata section from loop xml file.

* Remove m_num_iterations initialization, it is done during validate_and_infer_types().
2021-01-26 12:25:06 +03:00
Nikolay Shchegolev
245bc33e8a [CPU] GatherElements implementation. (#3860) 2021-01-26 09:53:20 +03:00
Andrew Bakalin
09e2231720 [IE Common][VPU]: Fix small input size inference for dynamic model (#3847)
* eliminate Unsqueeze+Gather pair, when Gather gathers data by 1 dimension which was previously added by Unsqueeze which is actually doing nothing.
* calculate K only once in StaticShapeTopK. The problem happens when we have ShapeOf->Concat->ReduceMin subgraph for K evaluation. If we have a pretty small input size, the value that we received from ShapeOf may be less than one that it is concatenated with (e.g. ShapeOf 283 vs const 300), so ReduceMin returns 283. After ShapeOf elimination we don't have a chance to propagate 283 so we get 300 as a result and shape inference fail then. There are no problems with bigger input sizes just because ShapeOf always propagates value >300 and there are no such mismatch.
2021-01-25 19:17:32 +03:00