[TFLite] Custom attribute reading and While operation support (#17932)
* Custom attribute reading and While operation support * Rearanges FLATBUFFERS_LOCALE_INDEPENDENT setting * Style * Make flatbuffers code as version independent as possible * Comments addressed
This commit is contained in:
committed by
GitHub
parent
1588a33217
commit
dd02a0f440
30
tests/layer_tests/tensorflow_lite_tests/test_tfl_While.py
Normal file
30
tests/layer_tests/tensorflow_lite_tests/test_tfl_While.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Copyright (C) 2018-2023 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
import tensorflow as tf
|
||||
|
||||
from common.tflite_layer_test_class import TFLiteLayerTest
|
||||
|
||||
|
||||
class TestTFLiteWhileLayerTest(TFLiteLayerTest):
|
||||
inputs = ["Input"]
|
||||
outputs = ["While"]
|
||||
allowed_ops = ["ADD", "LESS", "RESHAPE", "WHILE"]
|
||||
|
||||
def make_model(self, params):
|
||||
tf.compat.v1.reset_default_graph()
|
||||
with tf.compat.v1.Session() as sess:
|
||||
i = tf.compat.v1.placeholder(dtype=tf.float32, shape=[1], name=self.inputs[0])
|
||||
c = lambda i: tf.less(i, [10])
|
||||
b = lambda i: (tf.add(i, [1]), )
|
||||
tf.while_loop(c, b, [i], name=self.outputs[0])
|
||||
net = sess.graph_def
|
||||
return net
|
||||
|
||||
@pytest.mark.parametrize("params", [dict()])
|
||||
@pytest.mark.nightly
|
||||
def test_while(self, params, ie_device, precision, temp_dir):
|
||||
pytest.xfail("CVS-112884")
|
||||
self._test(ie_device, precision, temp_dir, params)
|
||||
Reference in New Issue
Block a user