code: def make_strided_slice_tests(options):
      """Make a set of tests to do strided_slice."""
  
      # TODO(soroosh): add test/support for uint8.
      test_parameters = [
          # 4-D (basic cases with const/non-const indices).
          {
              "dtype": [tf.float32, tf.int32, tf.int64, tf.bool],
              "index_type": [tf.int32],
              "input_shape": [[12, 2, 2, 5]],
              "strides": [None, [2, 1, 3, 1]],
              "begin": [[0, 0, 0, 0]],
              "end": [[12, 2, 2, 5]],
              "begin_mask": [None],
              "end_mask": [None],
              "shrink_axis_mask": [None],
              "constant_indices": [False, True],
              "fully_quantize": [False],
          },
          # 4-D with non-trivial begin & end.
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[12, 2, 2, 5]],
              "begin": [[0, 0, 0, 0], [1, 0, 1, 0]],
              "end": [[8, 2, 2, 3], [12, 2, 2, 5]],
              "strides": [None, [2, 1, 3, 1]],
              "begin_mask": [None, 8],
              "end_mask": [None, 3],
              "shrink_axis_mask": [None, 15, -1],
              "constant_indices": [True],
              "fully_quantize": [False],
          },
          # Begin, end, strides dim are different from input shape
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[12, 2, 2, 5]],
              "begin": [[0]],
              "end": [[1]],
              "strides": [None, [1]],
              "begin_mask": [0],
              "end_mask": [0],
              "shrink_axis_mask": [1],
              "constant_indices": [True, False],
              "fully_quantize": [False],
          },
          # 2-D
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[2, 3]],
              "begin": [[0, 0]],
              "end": [[2, 2]],
              "strides": [None, [2, 2]],
              "begin_mask": [None, 1, 2],
              "end_mask": [None, 1, 2],
              "shrink_axis_mask": [None, 1, 2, 3, -1],
              "constant_indices": [False, True],
              "fully_quantize": [False],
          },
          # Negative strides
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[2, 3]],
              "begin": [[0, -1]],
              "end": [[2, -3]],
              "strides": [[1, -1]],
              "begin_mask": [None, 1, 2],
              "end_mask": [None, 1, 2],
              "shrink_axis_mask": [None, 1, 2, 3, -1],
              "constant_indices": [False],
              "fully_quantize": [False],
          },
          # 4-D (cases with const indices and batchsize of 1).
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[1, 2, 2, 5]],
              "strides": [None, [1, 1, 1, 1]],
              "begin": [[0, 0, 0, 0], [0, 1, 1, 3]],
              "end": [[1, 2, 2, 5], [1, 2, 2, 4]],
              "begin_mask": [None],
              "end_mask": [None],
              "shrink_axis_mask": [None],
              "constant_indices": [True],
              "fully_quantize": [True],
          },
          # Begin, end, strides dim are different from input shape
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[12, 2, 2, 5]],
              "begin": [[0]],
              "end": [[1]],
              "strides": [None, [1]],
              "begin_mask": [0],
              "end_mask": [0],
              "shrink_axis_mask": [1],
              "constant_indices": [True],
              "fully_quantize": [True],
          },
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[1, 1, 2]],
              "begin": [[1]],
              "end": [[0]],
              "strides": [[1]],
              "begin_mask": [0],
              "end_mask": [1],
              "shrink_axis_mask": [0],
              "constant_indices": [True, False],
              "fully_quantize": [False],
          },
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[1, 1, 2]],
              "begin": [[1, 0, 0]],
              "end": [[0, -1, -1]],
              "strides": [[1, 1, 1]],
              "begin_mask": [6],
              "end_mask": [7],
              "shrink_axis_mask": [0],
              "constant_indices": [True, False],
              "fully_quantize": [False],
          },
          # String input.
          {
              "dtype": [tf.string],
              "index_type": [tf.int32],
              "input_shape": [[12, 2, 2, 5]],
              "begin": [[0, 0, 0, 0]],
              "end": [[8, 2, 2, 3]],
              "strides": [[2, 1, 3, 1]],
              "begin_mask": [8],
              "end_mask": [3],
              "shrink_axis_mask": [None],
              "constant_indices": [True, False],
              "fully_quantize": [False],
          },
          # ellipsis_mask and new_axis_mask.
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[5, 5, 7, 7]],
              "begin": [[0, 0, 0, 0]],
              "end": [[2, 3, 4, 5]],
              "strides": [[1, 1, 1, 1]],
              "begin_mask": [0, 8],
              "end_mask": [0, 2],
              "shrink_axis_mask": [0, 4],
              "ellipsis_mask": [2, 4],
              "new_axis_mask": [1, 6],
              "constant_indices": [True],
              "fully_quantize": [False],
          },
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[5, 6, 7]],
              "begin": [[0, 0, 0]],
              "end": [[2, 3, 4]],
              "strides": [[1, 1, 1]],
              "begin_mask": [0],
              "end_mask": [0],
              "shrink_axis_mask": [0, 2],
              "ellipsis_mask": [2],
              "new_axis_mask": [1, 2, 3, 4, 5],
              "constant_indices": [False],
              "fully_quantize": [False],
          },
          # Shrink_axis and add_axis mask both set
          {
              "dtype": [tf.float32],
              "index_type": [tf.int32],
              "input_shape": [[6, 7, 8]],
              "begin": [[0, 0, 0, 0]],
              "end": [[2, 3, 4, 5]],
              "strides": [[1, 1, 1, 1]],
              "begin_mask": [0],
              "end_mask": [0],
              "new_axis_mask": [10],
              "shrink_axis_mask": [1],
              "constant_indices": [True],
              "fully_quantize": [False],
          },
      ]
      _make_strided_slice_tests(
          options, test_parameters, expected_tf_failures=29
      )
  
file_path: tensorflow-upstream/tensorflow/lite/testing/op_tests/strided_slice.py
imports: import numpy
  import tensorflow
  from tensorflow.lite.testing.zip_test_utils import create_tensor_data
  from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
  from tensorflow.lite.testing.zip_test_utils import MAP_TF_TO_NUMPY_TYPE
  from tensorflow.lite.testing.zip_test_utils import register_make_test_function
label_desc: Use image node_id 2 for calling a global function with example usage: make_strided_slice_tests(options) without return types