Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completely transition of MO to Interpolate-4 #970

Merged
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
344 commits
Select commit Hold shift + click to select a range
ccfb890
Refactored infer function and function supported_attrs for the layer …
vgavrilo Jul 16, 2020
34ca13f
Small change.
vgavrilo Jul 16, 2020
5e80cab
Deleted unneeded checks in transformations ResizeToInterpolate2D and …
vgavrilo Jul 16, 2020
c0b89b3
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 16, 2020
e345d84
Small fix in the extractor of ONNX Resize.
vgavrilo Jul 16, 2020
f3e366e
Now the extractor of TF ResizeBilinear generates Interpolate-1 again,…
vgavrilo Jul 16, 2020
25abdc2
Now the extractor of TF ResizeNearest generates Interpolate-1 again, …
vgavrilo Jul 16, 2020
e0ec55c
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 16, 2020
430c2f2
Added static method get_axis into class Interpolate.
vgavrilo Jul 16, 2020
d36306d
Refactored class CanBeFused in the transformation InterpolateSequence…
vgavrilo Jul 16, 2020
3b233b8
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 16, 2020
db755d6
Fixed transformation InterpolateSequenceToInterpolate according to th…
vgavrilo Jul 16, 2020
106f623
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 16, 2020
48cbf3e
Started to write support of Interpolate-4 in the transformation Inter…
vgavrilo Jul 16, 2020
2d699cb
Added support for Interpolate-4 into the transformation InterpolateWi…
vgavrilo Jul 16, 2020
c927fb2
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 16, 2020
264b5de
Added support for Interpolate-4 into the transformation InterpolateCo…
vgavrilo Jul 16, 2020
83c59a2
Added support for Interpolate-4 into the transformation InterpolateRe…
vgavrilo Jul 16, 2020
0705ce6
Added support for Interpolate-4 into the transformation InterpolateTr…
vgavrilo Jul 16, 2020
cafe47f
Started to add test for opset4 case of the transformation Interpolate…
vgavrilo Jul 16, 2020
cbb203a
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 16, 2020
c146e58
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 17, 2020
f00de1f
Added test for InterpolateSequenceToInterpolate (test_2d_interpolate_…
vgavrilo Jul 17, 2020
9108bae
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 17, 2020
0c3bc99
Added test for InterpolateSequenceToInterpolate (test_2d_interpolate_…
vgavrilo Jul 17, 2020
d23b09c
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 17, 2020
395c80f
Added another test for InterpolateSequenceToInterpolate (test_2d_inte…
vgavrilo Jul 17, 2020
a2c250c
Added another test for InterpolateSequenceToInterpolate (test_3d_inte…
vgavrilo Jul 17, 2020
73ef76b
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 17, 2020
521499e
Finished addition of tests for opset4 case of InterpolateSequenceToIn…
vgavrilo Jul 17, 2020
61b0a97
Small change.
vgavrilo Jul 17, 2020
2b8b1aa
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 20, 2020
0ed79d8
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 27, 2020
721e634
Now opset is only opset1 or opset4 in the transformation InterpolateT…
vgavrilo Jul 27, 2020
5e7a012
Small fixes in transformations ResizeToInterpolate2D and ResizeToInte…
vgavrilo Jul 27, 2020
0f2973f
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 27, 2020
a4ba4ac
Deleted reading of unused ONNX attributes.
vgavrilo Jul 27, 2020
f72f2c3
Fixed docstring of the transformation InterpolateV1ToInterpolateV4.
vgavrilo Jul 27, 2020
f2b8138
Added node name in assert about axes input.
vgavrilo Jul 27, 2020
5b3bb88
Fixes in the definition of the operation ONNXResize11.
vgavrilo Jul 27, 2020
cf0ccd7
Now Interpolate-4 cannot have 'extension' as opset.
vgavrilo Jul 27, 2020
71fd41c
Now the transformation InterpolateV1ToInterpolateV4 uses find_and_rep…
vgavrilo Jul 27, 2020
b04aec4
Fixed tests for transformations InterpolateReshapeWA and InterpolateC…
vgavrilo Jul 27, 2020
50862fe
Fixed some tests.
vgavrilo Jul 27, 2020
ede09df
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 27, 2020
f643e10
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jul 30, 2020
6a603af
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Aug 15, 2020
69c6517
Rewritten operation Interpolate-4 class according to new variant of d…
vgavrilo Aug 15, 2020
33eb66e
Some fixes in ONNXResize11 operation class.
vgavrilo Aug 15, 2020
38fb836
Now the transformation ONNXResize11ToInterpolate generates Interpolat…
vgavrilo Aug 15, 2020
2ef3da0
Now the transformation UpsampleToResample generates Interpolate-4 wit…
vgavrilo Aug 15, 2020
8794179
Now the transformation NearestNeighborUpsampling generates Interpolat…
vgavrilo Aug 15, 2020
3b00883
Now transformations ResizeToInterpolate2D and ResizeToInterpolate3D g…
vgavrilo Aug 15, 2020
4aad7cc
Now the transformation SplitConcatPairToInterpolate generates Interpo…
vgavrilo Aug 15, 2020
35ba901
Now the transformation UnsqueezeTileReshapeBlockToInterpolate generat…
vgavrilo Aug 15, 2020
bbbd149
Now the transformation InterpolateV1ToInterpolateV4 generates Interpo…
vgavrilo Aug 15, 2020
c447693
Some fixes.
vgavrilo Aug 15, 2020
6ff019b
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Aug 15, 2020
692cea0
Fixed the transformation InterpolateSequenceToInterpolate according t…
vgavrilo Aug 16, 2020
3c24433
Resolved merge conflicts.
vgavrilo Aug 21, 2020
4b2fddb
Fixed typos.
vgavrilo Aug 21, 2020
05f6fd3
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Aug 31, 2020
3a95552
Added shape_calculation_mode to supported_attrs.
vgavrilo Aug 31, 2020
db80a18
Resolved merge conflicts.
vgavrilo Sep 17, 2020
7a148c4
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 17, 2020
e724738
Small fixes.
vgavrilo Sep 17, 2020
49f3e58
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 18, 2020
7d24bba
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 21, 2020
5629ca5
Added operation ONNXResize10 and the transformation ONNXResize10ToInt…
vgavrilo Sep 21, 2020
add96b8
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 21, 2020
4da05d0
Fixed function correct_scales_using_dst_shape.
vgavrilo Sep 21, 2020
c1d3d17
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 22, 2020
7466452
Some fixes in InterpolateSequenceToInterpolate.
vgavrilo Sep 23, 2020
e3acdf0
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 23, 2020
9d15cbe
Fixed bug in the method __call__ of the class CanBeFused: now self.ac…
vgavrilo Sep 23, 2020
dc1179d
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 23, 2020
19bab13
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 25, 2020
881cf9a
Small change.
vgavrilo Sep 25, 2020
4c86f8a
Fixed tests for the transformation SplitConcatPairToInterpolate.
vgavrilo Sep 25, 2020
a7b3b55
Now transformations InterpolateWithConcat, InterpolateReshapeWA, Inte…
vgavrilo Sep 25, 2020
5816935
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 25, 2020
3eccc02
Fixed the transformation InterpolateTranspose for the case of Interpo…
vgavrilo Sep 25, 2020
8faec01
Written the back transformation InterpolateV4AxesCorrection to conver…
vgavrilo Sep 28, 2020
42ce380
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 28, 2020
23aa15d
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 28, 2020
0dee0e0
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 28, 2020
a4525a1
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Sep 30, 2020
f87d8a5
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Oct 6, 2020
cd88d87
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Oct 12, 2020
328cb06
Added PermuteInput in Interpolate-4 infer.
vgavrilo Oct 12, 2020
d88df47
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Oct 19, 2020
f9845cc
Fixed typos.
vgavrilo Oct 19, 2020
02a14cf
Deleted the transformation InterpolateAxesCorrection.
vgavrilo Oct 23, 2020
b706ef3
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Oct 23, 2020
2a7ca0d
Now Interpolate-4 permutes axis, not shape in input port 3.
vgavrilo Oct 23, 2020
b69f102
Small fix.
vgavrilo Oct 23, 2020
cf29db4
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Oct 23, 2020
d024d9d
Some fix.
vgavrilo Oct 23, 2020
03016e5
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Oct 23, 2020
1bcd0e2
Resolved merge conflict.
vgavrilo Nov 19, 2020
acce706
Fixed bug in the transformation UpsampleToResample.
vgavrilo Nov 19, 2020
74d9834
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 19, 2020
cd465d2
Added some debug prints.
vgavrilo Nov 20, 2020
4c59c30
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 20, 2020
462ab3a
Added more debug prints.
vgavrilo Nov 20, 2020
80a4ee4
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 20, 2020
0725dd5
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 23, 2020
baa3199
Now ONNX Upsample-9 operation is read as ONNXResize10.
vgavrilo Nov 23, 2020
22d84b8
Small fix.
vgavrilo Nov 23, 2020
7422660
Small fixes.
vgavrilo Nov 23, 2020
cf0021b
Fixed tests for the transformation SplitConcatPairToInterpolate.
vgavrilo Nov 23, 2020
24997fe
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 23, 2020
374b3ec
Deleted debug prints.
vgavrilo Nov 23, 2020
7172e2f
Deleted some debug prints.
vgavrilo Nov 23, 2020
a466c4a
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 23, 2020
818539f
Fixes in the transformation UnsqueezeTileReshapeBlockToInterpolate an…
vgavrilo Nov 23, 2020
98b8bff
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 23, 2020
ff120fc
Small fix in the transformation InterpolateSequenceToInterpolate.
vgavrilo Nov 23, 2020
80648f6
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 23, 2020
4971f97
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 24, 2020
b8d6732
Started to write nGraph transformation to convert Interpolate-1 to In…
vgavrilo Nov 24, 2020
8090eae
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 24, 2020
dc7c6bf
Deleted redundant files.
vgavrilo Nov 24, 2020
4bd3a6f
Small fixes.
vgavrilo Nov 24, 2020
536c0c6
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 24, 2020
94193c7
Small fix.
vgavrilo Nov 24, 2020
4f6ff0b
Written draft of the transformation Interpolate-1 -> Interpolate-4.
vgavrilo Nov 24, 2020
135b85e
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 24, 2020
9e46fc7
Small fix.
vgavrilo Nov 24, 2020
afc3587
Now ONNX Importer reads Resize-10 as Interpolate-4.
vgavrilo Nov 24, 2020
582739b
Fixes in the test onnx_model_resize10_import_only.
vgavrilo Nov 24, 2020
07580a8
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 24, 2020
17e8791
Small fix in the test for the conversion Interpolate-1 -> Interpolate-4.
vgavrilo Nov 24, 2020
5971826
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 25, 2020
3f45163
Small fixes.
vgavrilo Nov 25, 2020
a3a8a8c
Fixed NGraphReaderTests for Interpolate.
vgavrilo Nov 25, 2020
58557ed
Some fixes.
vgavrilo Nov 25, 2020
5f5bf88
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 25, 2020
1798b5c
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Nov 26, 2020
1f880ac
Deleted class for Resample operation.
vgavrilo Nov 26, 2020
4928796
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 1, 2020
afd840d
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 1, 2020
20465ef
Fix in the transformation NearestNeighborUpsampling: fixed precision …
vgavrilo Dec 1, 2020
9eb7f5b
Fixed typo.
vgavrilo Dec 1, 2020
cbc0e85
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 1, 2020
fbad6ec
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 2, 2020
639efe7
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 3, 2020
47b036e
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 7, 2020
a47fd58
Now the TF operations ResizeBilinear is readed as internal MO operati…
vgavrilo Dec 8, 2020
fa822e1
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 8, 2020
887b6f5
Small fix in BOM-file.
vgavrilo Dec 8, 2020
7029a7e
Added checks of existence of attributes of TF ResizeBilinear operation.
vgavrilo Dec 8, 2020
6bd66bd
Small fixes in the conversion of the internal MO operation TFResizeB…
vgavrilo Dec 8, 2020
b3e7744
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 8, 2020
113970d
Small fixes.
vgavrilo Dec 8, 2020
301f523
Small fixes.
vgavrilo Dec 8, 2020
8108097
Now the transformation ONNXResize10ToInterpolateV4 calculates sizes i…
vgavrilo Dec 9, 2020
29d9243
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 9, 2020
5af7fba
Added the internal MO operation TFResizeNearestNeighbor.
vgavrilo Dec 9, 2020
f70dbde
Fixes in the transformation SplitConcatPairToInterpolate and its tests.
vgavrilo Dec 9, 2020
16571d3
Fixes in the transformation UnsqueezeTileReshapeBlockToInterpolate an…
vgavrilo Dec 9, 2020
01cab23
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 9, 2020
794660b
Written the transformation that converts the internal operation TFRes…
vgavrilo Dec 9, 2020
98efa97
Now MO reads the TF operation ResizeNearestNeighbor as the internal M…
vgavrilo Dec 9, 2020
97d338e
Small fix.
vgavrilo Dec 9, 2020
193444d
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 10, 2020
b3a4d74
Now the specification of Interpolate-4 clarifies that the mode linear…
vgavrilo Dec 10, 2020
d94a171
Small fix.
vgavrilo Dec 11, 2020
248525a
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 11, 2020
82e5d83
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 14, 2020
80dd32e
Some fixes.
vgavrilo Dec 14, 2020
d1bab81
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 14, 2020
117e892
Moved the transformation ONNXResize10ToInterpolateV4 to the front stage.
vgavrilo Dec 14, 2020
9bfb166
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 14, 2020
66553a5
Deleted infer function and function supported_attrs for ONNXResize10 …
vgavrilo Dec 14, 2020
800a581
Deleted supported_attrs() for TFResizeBilinear and TFResizeNearestNei…
vgavrilo Dec 14, 2020
1e3b6b0
Some fixes.
vgavrilo Dec 14, 2020
a325aed
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 14, 2020
2273163
Fixes in the shape infer function of the nGraph operation Interpolate…
vgavrilo Dec 15, 2020
6377880
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 15, 2020
9f7d1d0
Deleted corner cases processing in transformations TFResizeBilinearTo…
vgavrilo Dec 15, 2020
baf5531
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 15, 2020
9bc0770
Rewritten the function replace_resize_bilinear.
vgavrilo Dec 16, 2020
402d4fb
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 16, 2020
de29b88
Written inner MO operation TFResize that covers TF operations ResizeB…
vgavrilo Dec 16, 2020
200d582
Now TF operations ResizeBilinear and ResizeNearestNeighbor are read a…
vgavrilo Dec 16, 2020
7984be8
Some changes in the shape infer function of nGraph op Interpolate-4.
vgavrilo Dec 16, 2020
17eb091
Small fix.
vgavrilo Dec 16, 2020
3ff86e5
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 16, 2020
963ea76
Some changes.
vgavrilo Dec 16, 2020
a1e9c33
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 16, 2020
1ed3fb7
The transformation TFResizeToInterpolateV4 is moved to the front stage.
vgavrilo Dec 16, 2020
1aee9dc
Deleted redundant assert.
vgavrilo Dec 17, 2020
2224b2a
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 17, 2020
768e5d4
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 17, 2020
111f995
Deleted transformations ResizeToInterpolate2D and ResizeToInterpolate3D.
vgavrilo Dec 17, 2020
eb447f9
Some renaming.
vgavrilo Dec 17, 2020
5d92fd2
Small change.
vgavrilo Dec 17, 2020
d4c020e
Deleted .copy() in the shape infer function of the internal operation…
vgavrilo Dec 17, 2020
d5931d9
Small fix.
vgavrilo Dec 17, 2020
3d58a40
Small fixes.
vgavrilo Dec 17, 2020
6f3f10e
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 17, 2020
a85d410
Added comment about the case when the input 'axes' of Interpolate-4 i…
vgavrilo Dec 17, 2020
447ae00
Written test for Interpolate-4 shape infer, for the case when the inp…
vgavrilo Dec 17, 2020
aa798d2
Some fixes.
vgavrilo Dec 17, 2020
6adff4b
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 17, 2020
1c6b632
Small fixes.
vgavrilo Dec 17, 2020
936f2c5
Small fix.
vgavrilo Dec 17, 2020
2e0c77d
Added yet another test for the case of non-constant 'axes' input of I…
vgavrilo Dec 18, 2020
180f487
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 18, 2020
92cfad3
Added some comment.
vgavrilo Dec 18, 2020
672d26d
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 18, 2020
ceb6f61
Small fix.
vgavrilo Dec 18, 2020
1933268
Reverted changes for InterpolateWithConcat.
vgavrilo Dec 21, 2020
17664d6
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 28, 2020
d734a59
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 30, 2020
dc408ed
Added type checks for all inputs of nGraph operation Interpolate-4.
vgavrilo Dec 30, 2020
970d799
Added u32 and u64 to supported element types of sizes and axes inputs…
vgavrilo Dec 30, 2020
6f88ef8
Fixed some functional tests.
vgavrilo Dec 31, 2020
6574f11
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Dec 31, 2020
588fb84
Resolved merge coflict.
vgavrilo Jan 11, 2021
c9b35e5
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 11, 2021
3dbcc5d
Some changes.
vgavrilo Jan 12, 2021
53fb697
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 12, 2021
fae7e66
Added helper function float32_array.
vgavrilo Jan 12, 2021
db733a0
Now the MO transformation InterpolateV1ToInterpolate preserves names …
vgavrilo Jan 13, 2021
6121ae4
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 13, 2021
6701d48
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 18, 2021
4cc4ae1
Resolved merge conflict.
vgavrilo Jan 19, 2021
2cc1b30
Small fix.
vgavrilo Jan 19, 2021
aa70dba
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 19, 2021
024bcf5
Small fix.
vgavrilo Jan 19, 2021
03c79a3
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 19, 2021
b1af009
Resolved merge conflict.
vgavrilo Jan 28, 2021
2003d16
Reverted some change.
vgavrilo Jan 28, 2021
ae23ae1
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 28, 2021
5bab57b
Small fixes.
vgavrilo Jan 29, 2021
3e9cdd4
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 29, 2021
2f4ef84
Small fix.
vgavrilo Jan 29, 2021
0921f8b
Small fix.
vgavrilo Jan 29, 2021
6cbf405
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 29, 2021
b3f2a0e
Small fix.
vgavrilo Jan 29, 2021
fc72901
Small fix.
vgavrilo Jan 29, 2021
2b9356a
Reverted changes in the nGraph reader tests for Interpolate-1.
vgavrilo Jan 29, 2021
730dcbd
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Jan 29, 2021
7ab4f86
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Feb 2, 2021
891cc65
Some revert.
vgavrilo Feb 2, 2021
6dfee8d
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Feb 3, 2021
6994833
Merge remote-tracking branch 'upstream/master' into vgavrilo/interpol…
vgavrilo Feb 5, 2021
d58fd22
Fixed some copyright year.
vgavrilo Feb 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/ops/image/Interpolate_4.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* **Type**: string
* **Default value**: none
* **Required**: *yes*
* **Note**: Only 2D and 4D tensors with `axes = {0, 1}` and `axes = {2, 3}` respectively are supported for `"mode" == "linear_onnx"`.

* *shape_calculation_mode*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,61 @@
NGRAPH_RTTI_DEFINITION(ngraph::pass::ConvertInterpolate1ToInterpolate4, "ConvertInterpolate1ToInterpolate4", 0);

ngraph::pass::ConvertInterpolate1ToInterpolate4::ConvertInterpolate1ToInterpolate4() {
MATCHER_SCOPE(ConvertInterpolate1ToInterpolate4);
vgavrilo marked this conversation as resolved.
Show resolved Hide resolved
auto interpolate1 = ngraph::pattern::wrap_type<ngraph::opset1::Interpolate>({pattern::any_input(pattern::has_static_rank()), pattern::any_input()});
auto interpolate1 = ngraph::pattern::wrap_type<ngraph::opset1::Interpolate>({pattern::any_input(pattern::has_static_shape()), pattern::any_input()});
ngraph::matcher_pass_callback callback = [this](pattern::Matcher& m) {
auto interpolate1 = std::dynamic_pointer_cast<ngraph::opset1::Interpolate>(m.get_match_root());
if (!interpolate1)
auto interpolationV0 = std::dynamic_pointer_cast<ngraph::opset1::Interpolate>(m.get_match_root());
if (!interpolationV0) {
return false;
}

auto interpolate_attrs = interpolate1->get_attrs();
auto input_shape_rank = interpolate1->input(0).get_partial_shape().rank().get_length();
auto& inp_partial_shape = interpolationV0->get_input_partial_shape(0);
auto& out_shape = interpolationV0->get_output_shape(0);
vgavrilo marked this conversation as resolved.
Show resolved Hide resolved
auto attrsV0 = interpolationV0->get_attrs();

// attrs
auto mode_v4 = ngraph::op::v4::Interpolate::InterpolateMode();
if (interpolate_attrs.mode == "nearest") {
mode_v4 = ngraph::op::v4::Interpolate::InterpolateMode::nearest;
} else if (interpolate_attrs.mode == "cubic") {
mode_v4 = ngraph::op::v4::Interpolate::InterpolateMode::cubic;
} else if (interpolate_attrs.mode == "linear") {
if (input_shape_rank < 5) {
mode_v4 = ngraph::op::v4::Interpolate::InterpolateMode::linear_onnx;
} else if (input_shape_rank == 5) {
mode_v4 = ngraph::op::v4::Interpolate::InterpolateMode::linear;
} else {
return false;
std::vector<float> scales(attrsV0.axes.size(), 1.0f);
if (inp_partial_shape.is_static()) {
vgavrilo marked this conversation as resolved.
Show resolved Hide resolved
auto inp_shape = inp_partial_shape.to_shape();
size_t i = 0;
for (std::size_t axis : attrsV0.axes) {
scales[i] = static_cast<float>(out_shape.at(axis))/inp_shape.at(axis);
i++;
}
}

auto scalesConstant = ngraph::op::Constant::create(ngraph::element::f32, {scales.size()}, scales);
auto axisConstant = ngraph::op::Constant::create(ngraph::element::i64, {attrsV0.axes.size()},
std::vector<std::size_t>{attrsV0.axes.begin(), attrsV0.axes.end()});

ngraph::op::v4::Interpolate::InterpolateAttrs attrsV4;
vgavrilo marked this conversation as resolved.
Show resolved Hide resolved

if (attrsV0.mode == "nearest") {
attrsV4.mode = ngraph::opset4::Interpolate::InterpolateMode::nearest;
} else if (attrsV0.mode == "linear") {
attrsV4.mode = ngraph::opset4::Interpolate::InterpolateMode::linear;
} else if (attrsV0.mode == "cubic") {
attrsV4.mode = ngraph::opset4::Interpolate::InterpolateMode::cubic;
} else if (attrsV0.mode == "linear_onnx") {
attrsV4.mode = ngraph::opset4::Interpolate::InterpolateMode::linear_onnx;
} else {
return false;
}
auto nearest_mode_v4 = ngraph::op::v4::Interpolate::NearestMode::floor;
auto shape_calculation_mode_v4 = ngraph::op::v4::Interpolate::ShapeCalcMode::sizes;
auto coordinate_transformation_mode_v4 = interpolate_attrs.align_corners ? ngraph::op::v4::Interpolate::CoordinateTransformMode::align_corners :
ngraph::op::v4::Interpolate::CoordinateTransformMode::asymmetric;
auto interpolate4_attr = ngraph::op::v4::Interpolate::InterpolateAttrs(mode_v4, shape_calculation_mode_v4,
interpolate_attrs.pads_begin, interpolate_attrs.pads_end,
coordinate_transformation_mode_v4, nearest_mode_v4, interpolate_attrs.antialias, -0.75);

// input
auto axes = interpolate_attrs.axes.to_vector();
auto axes_node = ngraph::opset4::Constant::create(element::i64, {axes.size()}, axes);
auto default_scales = std::vector<float>(axes.size(), 1.f);
auto scales_node = ngraph::opset4::Constant::create(element::f32, {axes.size()}, default_scales);
attrsV4.shape_calculation_mode = ngraph::opset4::Interpolate::ShapeCalcMode::sizes;
attrsV4.nearest_mode = ngraph::opset4::Interpolate::NearestMode::round_prefer_floor;
attrsV4.pads_begin = attrsV0.pads_begin;
attrsV4.pads_end = attrsV0.pads_end;
attrsV4.antialias = attrsV0.antialias;
attrsV4.coordinate_transformation_mode = ngraph::opset4::Interpolate::CoordinateTransformMode::half_pixel;
attrsV4.cube_coeff = -0.75f;
if (attrsV0.align_corners) {
attrsV4.coordinate_transformation_mode = ngraph::opset4::Interpolate::CoordinateTransformMode::align_corners;
}

auto interpolate4 = std::make_shared<ngraph::opset4::Interpolate>(interpolate1->input_value(0), interpolate1->input_value(1),
scales_node, axes_node, interpolate4_attr);
auto interpolateV4 = std::make_shared<ngraph::opset4::Interpolate>(interpolationV0->input_value(0), interpolationV0->input_value(1),
scalesConstant, axisConstant, attrsV4);

interpolate4->set_friendly_name(interpolate1->get_friendly_name());
ngraph::copy_runtime_info(interpolate1, interpolate4);
ngraph::replace_node(interpolate1, interpolate4);
interpolateV4->set_friendly_name(interpolationV0->get_friendly_name());
ngraph::copy_runtime_info(interpolationV0, interpolateV4);
ngraph::replace_node(interpolationV0, interpolateV4);
return true;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,57 @@ TEST_F(NGraphReaderTests, ReadInterpolateNetwork) {
</port>
</output>
</layer>
<layer id="1" name="interpolate" precision="FP32" type="Interp">
<data align_corners="0" pad_beg="0" pad_end="0" mode="linear" width="60" height="50"/>
<layer id="1" name="output_shape" precision="I64" type="Const">
<output>
<port id="0">
<dim>2</dim>
</port>
</output>
<blobs>
<custom offset="0" size="16"/>
</blobs>
</layer>
<layer id="2" name="scales" precision="FP32" type="Const">
<output>
<port id="0">
<dim>2</dim>
</port>
</output>
<blobs>
<custom offset="32" size="8"/>
</blobs>
</layer>
<layer id="3" name="axes" precision="I64" type="Const">
<output>
<port id="0">
<dim>2</dim>
</port>
</output>
<blobs>
<custom offset="16" size="16"/>
</blobs>
</layer>
<layer id="4" name="interpolate" precision="FP32" type="Interpolate">
<data antialias="False" coordinate_transformation_mode="half_pixel" cube_coeff="-0.75" mode="linear" nearest_mode="round_prefer_floor" pads_begin="0,0,0,0" pads_end="0,0,0,0" shape_calculation_mode="sizes"/>
<input>
<port id="0">
<dim>1</dim>
<dim>2</dim>
<dim>48</dim>
<dim>80</dim>
</port>
<port id="1">
<dim>2</dim>
</port>
<port id="2">
<dim>2</dim>
</port>
<port id="3">
<dim>2</dim>
</port>
</input>
<output>
<port id="1">
<port id="4" precision="FP32">
<dim>1</dim>
<dim>2</dim>
<dim>50</dim>
Expand All @@ -101,16 +140,26 @@ TEST_F(NGraphReaderTests, ReadInterpolateNetwork) {
</layer>
</layers>
<edges>
<edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
<edge from-layer="0" from-port="0" to-layer="4" to-port="0"/>
<edge from-layer="1" from-port="0" to-layer="4" to-port="1"/>
<edge from-layer="2" from-port="0" to-layer="4" to-port="2"/>
<edge from-layer="3" from-port="0" to-layer="4" to-port="3"/>
</edges>
</net>
)V0G0N";
compareIRs(model, modelV5, 16, [](Blob::Ptr& weights) {
auto *data = weights->buffer().as<int64_t *>();
data[0] = 50;
data[1] = 60;
compareIRs(model, modelV5, 40, [](Blob::Ptr& weights) {
auto *i64data = weights->buffer().as<int64_t *>();
i64data[0] = 50;
i64data[1] = 60;
i64data[2] = 2;
i64data[3] = 3;

auto *fdata = reinterpret_cast<float *>(i64data + 4);
fdata[0] = 50.0 / 48.0;
fdata[1] = 60.0 / 80.0;
});
}

TEST_F(NGraphReaderTests, ReadInterpolate2Network) {
std::string model = R"V0G0N(
<net name="Network" version="10">
Expand Down Expand Up @@ -187,18 +236,57 @@ TEST_F(NGraphReaderTests, ReadInterpolate2Network) {
</port>
</output>
</layer>
<layer id="1" name="interpolate" precision="FP32" type="Interp">
<data align_corners="0" pad_beg="0" pad_end="0" mode="linear" width="60" height="50"/>
<layer id="1" name="output_shape" precision="I64" type="Const">
<output>
<port id="0">
<dim>4</dim>
</port>
</output>
<blobs>
<custom offset="0" size="32"/>
</blobs>
</layer>
<layer id="2" name="scales" precision="FP32" type="Const">
<output>
<port id="0">
<dim>4</dim>
</port>
</output>
<blobs>
<custom offset="64" size="16"/>
</blobs>
</layer>
<layer id="3" name="axes" precision="I64" type="Const">
<output>
<port id="0">
<dim>4</dim>
</port>
</output>
<blobs>
<custom offset="32" size="32"/>
</blobs>
</layer>
<layer id="4" name="interpolate" precision="FP32" type="Interpolate">
<data antialias="False" coordinate_transformation_mode="half_pixel" cube_coeff="-0.75" mode="linear" nearest_mode="round_prefer_floor" pads_begin="0,0,0,0" pads_end="0,0,0,0" shape_calculation_mode="sizes"/>
<input>
<port id="0">
<dim>1</dim>
<dim>2</dim>
<dim>48</dim>
<dim>80</dim>
</port>
<port id="1">
<dim>4</dim>
</port>
<port id="2">
<dim>4</dim>
</port>
<port id="3">
<dim>4</dim>
</port>
</input>
<output>
<port id="1">
<port id="4" precision="FP32">
<dim>1</dim>
<dim>2</dim>
<dim>50</dim>
Expand All @@ -208,16 +296,29 @@ TEST_F(NGraphReaderTests, ReadInterpolate2Network) {
</layer>
</layers>
<edges>
<edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
<edge from-layer="0" from-port="0" to-layer="4" to-port="0"/>
<edge from-layer="1" from-port="0" to-layer="4" to-port="1"/>
<edge from-layer="2" from-port="0" to-layer="4" to-port="2"/>
<edge from-layer="3" from-port="0" to-layer="4" to-port="3"/>
</edges>
</net>
)V0G0N";
compareIRs(model, modelV5, 32, [](Blob::Ptr& weights) {
auto *data = weights->buffer().as<int64_t *>();
data[0] = 1;
data[1] = 2;
data[2] = 50;
data[3] = 60;
compareIRs(model, modelV5, 80, [](Blob::Ptr& weights) {
auto *i64data = weights->buffer().as<int64_t *>();
i64data[0] = 1;
i64data[1] = 2;
i64data[2] = 50;
i64data[3] = 60;
i64data[4] = 0;
i64data[5] = 1;
i64data[6] = 2;
i64data[7] = 3;

auto *fdata = reinterpret_cast<float *>(i64data + 8);
fdata[0] = 1.0;
fdata[1] = 1.0;
fdata[2] = 50.0 / 48.0;
fdata[3] = 60.0 / 80.0;
});
}

Expand Down Expand Up @@ -399,4 +500,4 @@ TEST_F(NGraphReaderTests, ReadInterpolate4Network) {
fdata[2] = 2.0;
fdata[3] = 2.0;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST(TransformationTests, ConvertInterpolate1ToInterpolate4) {
{
auto data_node = std::make_shared<opset1::Parameter>(element::f32, Shape{2, 4, 30, 30});
auto out_shape_node = opset1::Constant::create(element::i32, Shape{4}, {2, 4, 40, 40});
auto default_scales_node = opset1::Constant::create(ngraph::element::f32, Shape{4}, {1.f, 1.f, 1.f, 1.f});
auto default_scales_node = opset1::Constant::create(ngraph::element::f32, Shape{4}, {1.f, 1.f, 4.0f / 3.0f, 4.0f / 3.0f});
auto axes_node = opset1::Constant::create(ngraph::element::i64, Shape{4}, {0, 1, 2, 3});

auto interpolate4_attr = opset4::Interpolate::InterpolateAttrs(opset4::Interpolate::InterpolateMode::nearest,
Expand Down Expand Up @@ -94,10 +94,10 @@ TEST(TransformationTests, ConvertInterpolate1ToInterpolate4_1) {
{
auto data_node = std::make_shared<opset1::Parameter>(element::f32, Shape{2, 4, 30, 30});
auto out_shape_node = opset1::Constant::create(element::i32, Shape{2}, {40, 40});
auto default_scales_node = opset1::Constant::create(ngraph::element::f32, Shape{2}, {1.f, 1.f});
auto default_scales_node = opset1::Constant::create(ngraph::element::f32, Shape{2}, {4.0f / 3.0f, 4.0f / 3.0f});
auto axes_node = opset1::Constant::create(ngraph::element::i64, Shape{2}, {2, 3});

auto interpolate4_attr = opset4::Interpolate::InterpolateAttrs(opset4::Interpolate::InterpolateMode::linear_onnx,
auto interpolate4_attr = opset4::Interpolate::InterpolateAttrs(opset4::Interpolate::InterpolateMode::linear,
opset4::Interpolate::ShapeCalcMode::sizes, std::vector<size_t>{0, 0, 0, 0}, std::vector<size_t>{0, 0, 0, 0},
opset4::Interpolate::CoordinateTransformMode::align_corners, opset4::Interpolate::NearestMode::floor,
false, -0.75);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void InterpolateTransformation::validate() {
if (attributes.mode == "nearest") {
ASSERT_EQ("ScaleShiftIE", typeName);
} else {
ASSERT_EQ("Interp", typeName);
ASSERT_TRUE("Interp" == typeName || "Interpolate" == typeName);
vgavrilo marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
Loading