Make a set of tests to do relu.
(options)
| 673 | |
| 674 | @register_make_test_function() |
| 675 | def make_abs_tests(options): |
| 676 | """Make a set of tests to do relu.""" |
| 677 | |
| 678 | # Chose a set of parameters |
| 679 | test_parameters = [{ |
| 680 | "input_shape": [[], [1], [2, 3], [1, 1, 1, 1], [1, 3, 4, 3], |
| 681 | [3, 15, 14, 3], [3, 1, 2, 4, 6], [2, 2, 3, 4, 5, 6]], |
| 682 | }] |
| 683 | |
| 684 | def build_graph(parameters): |
| 685 | input_tensor = tf.placeholder( |
| 686 | dtype=tf.float32, name="input", shape=parameters["input_shape"]) |
| 687 | out = tf.abs(input_tensor) |
| 688 | return [input_tensor], [out] |
| 689 | |
| 690 | def build_inputs(parameters, sess, inputs, outputs): |
| 691 | input_values = create_tensor_data( |
| 692 | np.float32, parameters["input_shape"], min_value=-10, max_value=10) |
| 693 | return [input_values], sess.run( |
| 694 | outputs, feed_dict=dict(zip(inputs, [input_values]))) |
| 695 | |
| 696 | make_zip_of_tests(options, test_parameters, build_graph, build_inputs) |
| 697 | |
| 698 | |
| 699 | @register_make_test_function() |
nothing calls this directly
no test coverage detected