[TF FE] Support TF1 While Control flow (#20105)

* [TF FE] Support TF1 While Control flow

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

* Apply code-style fix

* Update API for OpPlace to store back edge

* Fix build: no rvalue by reference passing

* Fix build issue: correct type

* Fix TF FE unit-tests

* Apply code-review feedback: remove unused vars

* Fix fusing complicated case of TF1 While

* Remove unused variable

* Update MO unit test

* Fix layer tests for While

* Handle Switch and NextIteration nodes connected directly

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

---------

Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
This commit is contained in:
Roman Kazantsev authored and GitHub committed 2023-10-02 09:56:10 +04:00
1 parent e2501a67d2
commit b409ea1930
23 files changed
+694 -168

No files matched your search

+1 -2
View File
@@ -312,9 +312,8 @@ def update_fallback_with_conversion_error(use_new_frontend: bool, is_tf: bool, e
conversion_error_re = r"^(\[TensorFlow\ Frontend\]\ Internal\ error\,\ no\ translator\ found\ for\ operation\(s\)\:\ )((\w+)(\,\ \w+)*)$"
conversion_error_match = re.findall(conversion_error_re, ex_msg, re.MULTILINE)
all_fallback_operations = [
# corresponds to TF1 While operation
# corresponds to TF1 TensorList operation
"TensorArrayScatterV3", "TensorArrayV3", "TensorArraySizeV3", "TensorArrayGatherV3",
"LoopCond", "Enter", "NextIteration", "Exit",
# corresponds to operations with complex tensors
"FFT", "FFT2D", "FFT3D", "IFFT", "IFFT2D", "IFFT3D",
"RFFT", "RFFT2D", "RFFT3D", "IRFFT", "IRFFT2D", "IRFFT3D",
@@ -243,8 +243,7 @@ class TestMoFreezePlaceholderTFFE(unittest.TestCase):
def test_conversion_failure_fallback_use_new_frontend(self):
with self.assertRaisesRegex(Exception,
"\[TensorFlow Frontend\] Internal error, no translator found for operation\(s\)\: "
"Enter\, Exit\, LoopCond\, Merge\, NextIteration\, Switch\, TensorArrayGatherV3\, "
"TensorArraySizeV3\, TensorArrayV3"):
"TensorArrayGatherV3\, TensorArrayReadV3\, TensorArraySizeV3\, TensorArrayV3\, TensorArrayWriteV3"):
self.basic("ctc_model_based.pbtxt", None, None, None, None,
None, None, True, True, True, False)