Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Cast input argument of tf.slice to int32 in unit test #369

Merged
merged 1 commit into from
Feb 3, 2020
Merged
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def test_tf_slice(self):
return

def my_func_1(x):
return tf.slice(x[0], x[1][0], [3, 1, 1, 2])
return tf.slice(x[0], tf.cast(x[1][0], tf.int32), [3, 1, 1, 2])

input1 = Input(shape=(2, 3, 5), name='inputs')
input2 = Input(shape=(4,), dtype=tf.int32, name='begin')
Expand All @@ -462,7 +462,7 @@ def my_func_1(x):
self.assertTrue(run_onnx_runtime('onnx_tf_slice', onnx_model, {"inputs": data1, 'begin': data2}, expected, self.model_files))

def my_func_2(x):
return tf.slice(x[0], [0, 1, 0, 2], x[1][0])
return tf.slice(x[0], [0, 1, 0, 2], tf.cast(x[1][0], tf.int32))

input1 = Input(shape=(2, 3, 5), name='inputs')
input2 = Input(shape=(4,), dtype=tf.int32, name='size')
Expand Down