Make a set of tests to do (float) tf.nn.elu.
(options)
| 698 | |
| 699 | @register_make_test_function() |
| 700 | def make_elu_tests(options): |
| 701 | """Make a set of tests to do (float) tf.nn.elu.""" |
| 702 | |
| 703 | test_parameters = [ |
| 704 | { |
| 705 | "input_shape": [[], [1], [2, 3], [1, 1, 1, 1], [1, 3, 4, 3], |
| 706 | [3, 15, 14, 3], [3, 1, 2, 4, 6], [2, 2, 3, 4, 5, 6]], |
| 707 | }, |
| 708 | ] |
| 709 | |
| 710 | def build_graph(parameters): |
| 711 | """Build the graph for the test case.""" |
| 712 | |
| 713 | input_tensor = tf.placeholder( |
| 714 | dtype=tf.float32, name="input", shape=parameters["input_shape"]) |
| 715 | out = tf.nn.elu(input_tensor) |
| 716 | return [input_tensor], [out] |
| 717 | |
| 718 | def build_inputs(parameters, sess, inputs, outputs): |
| 719 | """Build the inputs for the test case.""" |
| 720 | input_values = create_tensor_data( |
| 721 | np.float32, parameters["input_shape"], min_value=-4, max_value=10) |
| 722 | return [input_values], sess.run( |
| 723 | outputs, feed_dict=dict(zip(inputs, [input_values]))) |
| 724 | |
| 725 | make_zip_of_tests(options, test_parameters, build_graph, build_inputs) |
| 726 | |
| 727 | |
| 728 | @register_make_test_function() |
nothing calls this directly
no test coverage detected