code: def make_roll_tests(options):
      """Make a set of tests to do roll."""
  
      ext_test_parameters = test_parameters + [
          # Scalar axis.
          {
              "input_dtype": [tf.float32, tf.int32],
              "input_shape": [[None, 8, 4]],
              "shift": [-3, 5],
              "axis": [1, 2],
          }
      ]
  
      def set_dynamic_shape(shape):
          return [4 if x is None else x for x in shape]
  
      def get_shape(param):
          if np.isscalar(param):
              return []
          return [len(param)]
  
      def get_value(param, dtype):
          if np.isscalar(param):
              return np.dtype(dtype).type(param)
          return np.array(param).astype(dtype)
  
      def build_graph(parameters):
          input_tensor = tf.compat.v1.placeholder(
              dtype=parameters["input_dtype"],
              name="input",
              shape=parameters["input_shape"],
          )
          shift_tensor = tf.compat.v1.placeholder(
              dtype=tf.int64,
              name="shift",
              shape=get_shape(parameters["shift"]),
          )
          axis_tensor = tf.compat.v1.placeholder(
              dtype=tf.int64,
              name="axis",
              shape=get_shape(parameters["axis"]),
          )
          outs = tf.roll(input_tensor, shift_tensor, axis_tensor)
          return [input_tensor, shift_tensor, axis_tensor], [outs]
  
      def build_inputs(parameters, sess, inputs, outputs):
          input_value = create_tensor_data(
              parameters["input_dtype"],
              set_dynamic_shape(parameters["input_shape"]),
          )
          shift_value = get_value(parameters["shift"], np.int64)
          axis_value = get_value(parameters["axis"], np.int64)
          return [input_value, shift_value, axis_value], sess.run(
              outputs,
              feed_dict=dict(
                  zip(inputs, [input_value, shift_value, axis_value])
              ),
          )
  
      extra_convert_options = ExtraConvertOptions()
      extra_convert_options.allow_custom_ops = True
      make_zip_of_tests(
          options,
          ext_test_parameters,
          build_graph,
          build_inputs,
          extra_convert_options,
      )
  
file_path: tensorflow-upstream/tensorflow/lite/testing/op_tests/roll.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 ExtraConvertOptions
  from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
  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_roll_tests(options) and returns: unknown, list, np, list,  list, list,  sess, list, np