MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / make_relu_tests

Function make_relu_tests

tensorflow/lite/testing/generate_examples_lib.py:868–889  ·  view source on GitHub ↗

Make a set of tests to do relu.

(options)

Source from the content-addressed store, hash-verified

866
867@register_make_test_function()
868def make_relu_tests(options):
869 """Make a set of tests to do relu."""
870
871 # Chose a set of parameters
872 test_parameters = [{
873 "input_shape": [[], [1], [2, 3], [1, 1, 1, 1], [1, 3, 4, 3],
874 [3, 15, 14, 3], [3, 1, 2, 4, 6], [2, 2, 3, 4, 5, 6]],
875 }]
876
877 def build_graph(parameters):
878 input_tensor = tf.placeholder(
879 dtype=tf.float32, name="input", shape=parameters["input_shape"])
880 out = tf.nn.relu(input_tensor)
881 return [input_tensor], [out]
882
883 def build_inputs(parameters, sess, inputs, outputs):
884 input_values = create_tensor_data(
885 np.float32, parameters["input_shape"], min_value=-4, max_value=10)
886 return [input_values], sess.run(
887 outputs, feed_dict=dict(zip(inputs, [input_values])))
888
889 make_zip_of_tests(options, test_parameters, build_graph, build_inputs)
890
891
892@register_make_test_function()

Callers

nothing calls this directly

Calls 1

make_zip_of_testsFunction · 0.85

Tested by

no test coverage detected