* Added transposes insertion for Parameter and Result.
* Separated into several transformations.
* Corrected runtime_info format.
* Fixed runtime info serialization.
* Code refactoring.
* Corrected checks.
* Added debug output.
* Added check.
* Fixed unit tests.
* Changed old api map format, removed debug output.
* Moved serialize to rt_info property, code corrections.
* Refactored RTInfo class.
* Small corrections.
* Small corrections.
* Removed redurant import.
* Added tests, added undefined default type.
* Code reformat.
* Fixed serialization unit tests.
* Added comment.
* Added comment.
* Small test correction.
* Changed default values of old_api_map to values from old API IR.
* np.array -> int64_array
* Update MO to use FE to read IR; Swith MO IR version to 11
* Preserve output node name when inserting Transpose
* Codestyle
* Fix layer tests
* Pylint fix
* Disable ref_graphs comparision in layer tests
* codestyle
* Updated MO IR reader.
* Moved version initialization to constructor of OldApiMap.
* Added shape infer after transpose insertion.
* Fixed Pylint
* Removed wrong attribute removal.
* Added transposes insertion for Parameter and Result.
* Separated into several transformations.
* Corrected runtime_info format.
* Fixed runtime info serialization.
* Code refactoring.
* Corrected checks.
* Added debug output.
* Added check.
* Fixed unit tests.
* Changed old api map format, removed debug output.
* Moved serialize to rt_info property, code corrections.
* Refactored RTInfo class.
* Small corrections.
* Small corrections.
* Removed redurant import.
* Added tests, added undefined default type.
* Code reformat.
* Fixed serialization unit tests.
* Added comment.
* Added comment.
* Small test correction.
* Changed default values of old_api_map to values from old API IR.
* np.array -> int64_array
* Update MO to use FE to read IR; Swith MO IR version to 11
* Preserve output node name when inserting Transpose
* Codestyle
* Fix layer tests
* Pylint fix
* Disable ref_graphs comparision in layer tests
* codestyle
* Updated MO IR reader.
* Moved version initialization to constructor of OldApiMap.
* Added shape infer after transpose insertion.
* Fixed Pylint
* Removed wrong attribute removal.
* Serialize fix.
Co-authored-by: Gleb Kazantaev <gleb.kazantaev@intel.com>
* Change sort functions to fix incorrect order
* Add separate sorts for different cases
* Update sort function to correct control flow edges handling
* Refactor all sorts for dictionary ordering
* Update build_graph function for correct control_flow edges creation
* Add tests for nodes and ports sort equality
* Fix wrong port value
* Add direct conversion from bool to int
* Use .replace instead of .strip
* Add test with both control_flow and ordinary edges, refactored edges lists filling
* Refactored nodes dict filling
* Delete unused test code
* Allow MO to generate IR with -1 in dimensions
* Some fixes to support -1 for StridedSlice operation
* Updated TensorArrayGatherV3 shape infer to support dynamic output shape
* Several fixes to support undefined dimensions in the Broadcast,Reshape,Slice and Tile
* Fixed bug in the normalization transformation of TF NMS to opset NMS
* Updated shape infer functions related to StridedSlice and NMS
* Updated Select shape inference function to use common shape broadcasting function supporting dynamism
* Fixed operation TFResize shape infer function to work correctly for case when model is converted with --disable_nhwc_to_nchw
* Dynamic Range and update asserts in NMS
* Changed the way how dynamic dimensions are specified. Refactored shape inference functions and common places to use new approach
* More fixes to support dynamic shapes
* More fixes for support of dynamic shapes
* Fixed generation of IR with dynamic dimensions
* Allow reading IRs with undefined dimensions
* More changes in the IE to support dynamic dimensions
* Fixes for Switch, Merge, Concat shape and value infer related to dynamism
* Fixed TensorArray related ops to properly handle dynamic dimensions. Fixed StridedSlice infer for case with new_axis
* Fixed shape_for_layout function to generate masked array
* Fixed shape inference for Convolution and Poolings to support dynamic spatial dimensions
* Updated shape infer functions for CTCGreedyDecotder, CTCLoss and Enter
* Fixed shape inference with dynamic dimensions for MatMul, Split, Upsample, SpaceToBatch, some fixes for the TI
* Fixes for undefined dimensions support for Proposal and DetectionOutput
* Fixed ExtractImagePatches, DepthToSpace and RegionYolo shape infer functions to work with partially dynamic dimensions
* Changes in tf_window_op_pad_infer to better work with dynamic dimensions
* Fixed output shape calculation for StridedSlice operation
* More StridedSlice fixes
* Fixed resolve_convolution_with_group
* Fixed unit tests
* Fixed unit tests
* Fixed Switch op unit tests
* Fixed shape inference for Upsample operation
* Updated unit tests for the Concat operation
* Fixed eltwise shape infer unit tests
* Fixed shape infer tests for Convolution and DetectionOutput ops
* Fixed Crop shape infer function tests
* Fixed Slice op unit test and minor fix in the shape inference. Fixed emitter
* Updated unit test for telemetry and match_shape function for dynamism
* Fixed unit test for the DetectionOutput
* Added support for the TF ClipByValue operation
* Fixed GatherND shape inference for dynamic shapes support
* Dynamic shapes support for the MO IR Reader
* Fixed BlockLSTM operation to not work as an extractor
* Allow to serialize IRs with partially defined shapes
* Updated SelectBroadcast transformation to not check shape values
* Fixed MO IR comparator
* Fixed SS value propagation when slices are dynamic
* Do not re-run graph clean-up for ProposalMutation
* Fixed InterpolateSequenceToInterpolate transformation to support dynamic dimensions
* Fixed Loop iteration count calculation and reading IteratorGetNext shapes
* Fixed unit test for serialization
* Fixed serialization test
* Fixed RandomUniform shape infer
* Fixed several transformations related to RNN to respect dynamic output shapes
* Fixed Deconvolutin shape calculation for dynamic batch. Eltwise shape infer improvements
* Fixed shape infer functions for ExperimentalDetectron ops, reverted changes for NonZero and removed debug prints
* Fixed check for dynamism of a list, fixed value propagation for Concat op and remove redundant shape infer for reshape
* Update Eltwise value propagation to use np.ma
* Fixed ExpandDims shape infer function
* Shape infer functions fixes and improvements
* Remove Accum op from the MO
* Updated activation functions shape infer
* Removed unsupported operation Correlation
* Fixed shape infers for several functions
* Removed unsupported DataAugmentation operation
* Fixed shape infer functions for several ops in extensions directory
* Removed not-support operation PowerFile
* Removed unsupported SpatialTransformer,SimplerNMS and PredictionHeatmap operations
* More shape infer functions updates
* Merge shape infer fix
* Fixed typo
* Fixed TensorArraySize shape infer function
* Fixed VariadicSplit and Squeeze shape infer
* Fixed ONNX models Parameter extractor
* Updated Select value propagation for the dynamic case
* Fixed ReorgYolo shape infer and test
* Removed unnecessary tests
* Fixed Tile shape infer
* Fixed SparseFillEmptryRows unit tests
* Fixed package bom
* Added extractor for the TF operation Mod
* Fixed value propagation for MatMul operation
* Updated Parameter extender to generate shape_array when shape is partially defined only
* Fixed BOM file
* Fixed issue with the TF OD API models and DetectionOutput op. Now the shape infer function for the DO do not re-infer "num_classes" attribute value if it is already known
* Fixed unit test for the DO infer
* Fixed num classes calculation for the DO generation for Faster/Mask-RCNN models
* Changed NMS op to produce static output shape
* Restore dynamic output shape calculation for the NMS for NMS-5
* Fixed CellNormalizer transformation. It should work for static shapes only
* RNNCell Op class fixes
* Revert some changes
* Updated documentation with a list of supported operations
* Revert changes
* Fixes for the ConstantFill op
* Removed redundant SequenceLengthToMask transformation
* TensorArray* ops shape infer code style and refactoring
* Reverse some unnecessary changes in the ConvolutionNormalizer
* Fixes and unit tests for shape_array, compare_shapes, is_fully_defined functions
* Implemented shape_insert, shape_delete functions and tests for them
* Modified code to use shape_delete function
* Added usage of shape_insert function where necessary
* Use shape_insert function in many places
* Some fixes in shape inference for various ops
* Updated shape_delete function to support negative indices
* Changes and unit tests for the MatMul infer function
* Removed strange code from the TF Merge infer function
* Merge op shape infer fixes
* Fixed value propagation in the transformation EltwiseInputReshape.py for the dynamic dimension case
* Code cleanup
* Updated GatherND to support dynamic dimensions
* Minor fixes
* Fixed shape_insert and shape_delete to support np.int64 and np.int32 types
* Updated Upsample operation unit tests with dynamic input shapes
* Minor change in the extensions/back/ConvolutionNormalizer.py to make sure that input dimensions are static
* Fixed ConvertGroupedStridedSlice transformation and added unit tests
* Revert debug changes
* Fixed value propagation for Unsqueeze to work with partially defined input values
* Typo fix
* Added unit tests for the Unsqueeze op shape infer
* broadcasting functions changes and unit tests
* Fixed Tile value inference for partially defined input tensor
* Unit tests for Split and VariadicSplit ops
* Fixes for the Concat infer + unit tests
* Removed redundant tf_pack shape infer
* Fixed Concat value infer and added unit tests
* Fixed StridedSlice shape inference for case with dynamic slices
* Fixes related to StridedSlice shape infer, changes in tests
* Unit tests for the eltwise shape and value infer
* Fixed Pad op value propagation to allow dynamic input values to be propagated
* Unit test for Pooling dynamic input shape infer
* Squeeze op unit tests for dynamic input shape
* Added assert to the Squeeze op shape infer for case when squeeze dimension is dynamic value
* Added message to the MO when input shapes are dynamic
* Convolution dynamic unit test
* Removed redundant transformation GroupedConvWeightsNormalize
* Removed non-ascii character from the message
* Fixed typo in the BOM file
* Code style and comment fixes
* Fixed copy-paste issue in the DO shape infer function
* Fixed setting dynamic shape in the MO command line
* Added function to compare tensor with dynamic values. Fixes in the unit tests and shape infer functions
* Improved Reshape shape infer + added unit tests
* Fixed value propagation for Select op
* Renamed several internal functions, minor code fixes.
* Code style fixes
* Modified condition in the _set_shape method of the Port class to not check shape if the "override_output_shape" attribute is specified
* Fixed constant value propagation for ReduceOps when inputs have dynamic values. Added unit test
* Fixed shape infer for the Loop for dynamic dimensions case
* Fix in the NMS shape infer to avoid ragged numpy array generation. Fixed Scatter shape infer validation
* Improved shapes infer for eltwise ops with respect to dynamic dimensions
* Changed code comments
* Renamed tensor names in the ClipByValueTFTransformation
* Changed np.ma.allequal to strict_compare_tensors in the Merge op infer
* Chanded np.ma.allequal with strict_compare_tensor.
* Fixed Merge op value infer
* Fixed debug code
* Removed commented line
* Updated condition to check for dynamic shapes in the Partial infer to not fail for MxNet models
* Improvements to the get_shape_from_slice and is_dynamic_slice functions
* Reverted change in the `normalize_slices_attr` for ellipsis mask case
* Updated shape conditions in the ScatterNDBase op to support dynamic dimensions
* Crop op file refactoring
* Set "type" attribute to None for SparseFillEmptyRows op which is not from any opset
* Removed unnecessary extractor test
* Restored Crop operation type
* Removed "type" attribute from the Crop operation and updated the MO code to find Crop by "op" attribute
* Fixed If shape infer function to produce dynamic dimensions
* Updated If shape and value infer to properly work when condition is static
* Fixed fusing transformation check to work with dynamic dimensions. Change comparison in the shape_inference function to not use strict shapes comparison
* Optimize imports in the LayerNorm
* ConvertGroupedStridedSlice minor fixes related to dynamism support
* Fixed ConvertGroupedStridedSlice to properly check if the dimension is sliced
* Implement way to provide keep_output_port attribute to add_opoutput function
* Update tests
* Update comment
* Fake commit to pictures merge problem
* Change default value
* Add type
* Revert "Fake commit to pictures merge problem"
This reverts commit 41850765e0.
* Added handling of debug information in create_node().
* Code refactoring.
* Checks fixed.
* Added comments, added unit test.
* Renamed unit test class.
* Fixed port number in unit test.
* Make order of port names determined in IR
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Make port names in determined order and adopted tests
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Removed test-generator from all MO requirement files except the dev one
* Moved all MO unit tests files to a separate directory
* Added __init__.py files to the tests directory. Fixed importing paths for some unit tests
* Fixed imports in all unit tests. Moved all unit test related files from the MO code to the dedicated directory
* Renamed directory with unit test utils
* Updated imports in unit tests
* Fixed framework name attribute for onnx, mxnet.
* Fixed framework name attribute for caffe.
* Removed unnecessary attribute setting from add_opoutput()
* Added identity nodes adding to outputs in mxnet loader.
* Removed unnecessary reformat.
* Removed unnecessary reformat.
* Added check for empty name.
* Used nodes indices instead of node names in loader.
* Code refactoring, small bug fixed.
* added condition to disconnect method
* add unittest, rewrite the fix
* revert the second implementation, update test
Co-authored-by: yegor.kruglov <ykruglov@nnlvdp-mkaglins.inn.intel.com>
* 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
* 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.
* [MO] Implement TensorFlow 2 While support in MO
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Add extractors for both While and StatelessWhile and do minor changes
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Improve update_body_graph function and manage graph names properly
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Fix a map for original name of parameters from body and cond
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Implement draft version of support of TF2 Keras RNN
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Implement Keras LSTM and GRU support in MO
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Improve code for Keras RNN support
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Finalize implementation of TF2 Keras RNN support in MO
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply the first part of the comments after review #1
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Avoid use of explicit values of port indices in the transformation
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Finalize code after the first-round review
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Apply comments after the second-round review
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
* Generate TensorIterator without back edges from TensorFlow models
* Added a check in the MarkSubgraphsWithCorrectLayout to not fail when port is not connected
* Updated the 'protobuf2nx' to consume the graph protobuf message
* Cleanup TI from the IRv7 specific code
* Do not run some front transformations recursively
* Draft support for the ONNX Loop operation when 'cond' = True
* LoopToTI transformation changes
* Added draft of Loop operation and parser for ONNX Loop operation body
* Updated Loop body parser + added shape and type infer for the Loop operation
* Fixes for ONNX Loop operation parser
* Moved Loop parsing to Loop op extractor. Added generation of external edges for the Loop body ops
* Added support for ThresholdedRelu using decomposition
* Added support for Min ONNX operation
* Draft fixes for port_map generation for the Loop
* Rename transformation file and fix BOM
* Fixed shape inference for Loop scan outputs (axis is not None)
* Fixed shape inference for ONNX Loop operation
* Refactor checks in the TensorIteratorMerge transformation
* Code refactoring. Enabled commented transformations
* Documentation update for ONNX Loop, ThresholdedRelu and Min
* Fixed typo in the Loop front transformation where execution condition input is connected. Other refactorings
* Fixed in the Loop extractor
* Added printing 'internal_layer_id' attribute in the graph dumper
* Updated calculation of iterations number for the Loop
* Added missing code
* Fixed output port shapes and types generation for Loop operation
* Update function names and variable names in the Loop operation
* Fixed type inference for iteration count input
* Added removal of input/output ports of the Loop if they are not used
* Fixed renumbering Loop operations input/output ports to keep mandatory
* Fixed ThresholdedReluDecomposition transformation
* Updated MO IR Reader to know about Loop operation. But it is still not supported by the MO IR Reader
* Added unit test for Slice op shape infer (reverse the sequence of elements)
* Reverted changes in the ONNX loader function call to protobuf2nx
* Enable Reshape0DToSqueeze transformation recursively
* Refactored Loop operation support implementation
* Changed ThresholdedReluDecomposition to generate Const with shape [1] instead of scalar
* Code style and wording fixes
* Restored accidentally removed 'return' statement in the TI shape infer function
* Fixed comments
* Fixed comment
Co-authored-by: Evgeny Lazarev <elazarev.nnov@gmail.com>
* Updated ConcatOptimization transformation to work when one dimension of input to Concat is 0D
* Fixed ConcatOptimization transformation to reconnect input edges to Concat
* Completely re-written ConcatOptimization
* Updated Concat0D optimization transformation
* Fixed order of traversing Concat input ports
* Refactored ConcatOptimization transformation to use `delete_input_port` function
* Detele trailing unconnected ports in the ConcatOptimization.py
* Cleaner implementation of ConcatOptimization + unit test
* Remove unnnecessary ir_version checks in the MO
* Cleaned up 'backend_attrs_v2' function
* Small clean up from the 'TFCustomSubgraphCall'
* Clean up the MO extractor attributes mapping
* Renamed PreluOp to PReLU
* Removed back phase transformations related to IRv7
* Fixed setting value for the input port using the 'set_value' method
* Removed front and middle phase transformations related to IRv7
* Cleanup the rest of the Model Optimizer transformations from IRv7 specific transformations
* Final cleanup of the deprecated IR v7 related code
* Removed 'blobs_as_input' usage in the Model Optimizer.
* Removed function '_fuse_add' from the Model Optimizer since it is not used anymore.
* Removed 'keep_in_IR' node attribute for FakeQuantize ops in the MO
* Disabled failing gpu_engine.user_context test