Skip to content

Commit f422f9f

Browse files
authored
Merge pull request #1254 from dkurt:dnn_tflite_slice
StridedSlice test for TFLite
1 parent 8a2ab0a commit f422f9f

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

testdata/dnn/tflite/generate.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,10 @@ def keras_to_tf(model, input_shape):
154154

155155
leakyRelu, inp = keras_to_tf(leakyRelu, (1, 7, 7, 5))
156156
save_tflite_model(leakyRelu, inp, 'leakyRelu')
157+
158+
@tf.function(input_signature=[tf.TensorSpec(shape=[2, 1, 1, 4], dtype=tf.float32)])
159+
def strided_slice(x):
160+
return x[-1:, ..., ::2]
161+
162+
inp = np.random.standard_normal((2, 1, 1, 4)).astype(np.float32)
163+
save_tflite_model(strided_slice, inp, 'strided_slice')
1020 Bytes
Binary file not shown.
160 Bytes
Binary file not shown.
136 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)