Make a set of tests to do relu6.
(options)
| 918 | |
| 919 | @register_make_test_function() |
| 920 | def make_relu6_tests(options): |
| 921 | """Make a set of tests to do relu6.""" |
| 922 | |
| 923 | # Chose a set of parameters |
| 924 | test_parameters = [{ |
| 925 | "input_shape": [[], [1, 1, 1, 1], [1, 3, 4, 3], [3, 15, 14, 3], |
| 926 | [3, 1, 2, 4, 6], [2, 2, 3, 4, 5, 6]], |
| 927 | }] |
| 928 | |
| 929 | def build_graph(parameters): |
| 930 | input_tensor = tf.placeholder( |
| 931 | dtype=tf.float32, name="input", shape=parameters["input_shape"]) |
| 932 | out = tf.nn.relu(input_tensor) |
| 933 | return [input_tensor], [out] |
| 934 | |
| 935 | def build_inputs(parameters, sess, inputs, outputs): |
| 936 | input_values = create_tensor_data( |
| 937 | np.float32, parameters["input_shape"], min_value=-3, max_value=10) |
| 938 | return [input_values], sess.run( |
| 939 | outputs, feed_dict=dict(zip(inputs, [input_values]))) |
| 940 | |
| 941 | make_zip_of_tests(options, test_parameters, build_graph, build_inputs) |
| 942 | |
| 943 | |
| 944 | @register_make_test_function() |
nothing calls this directly
no test coverage detected