aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/testing
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-04-13 00:12:41 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-13 00:14:59 -0700
commit1b0c277405171a34c7f41e17cd76459dc36f7f82 (patch)
treeffed1ee7e0314ca98a8aed222b9d0214bf6ae21a /tensorflow/contrib/lite/testing
parent73cc1d5b6f95ff56207e4c42b62d383c2427fb75 (diff)
Implementation of Less
PiperOrigin-RevId: 192728635
Diffstat (limited to 'tensorflow/contrib/lite/testing')
-rw-r--r--tensorflow/contrib/lite/testing/BUILD1
-rw-r--r--tensorflow/contrib/lite/testing/generate_examples.py33
-rw-r--r--tensorflow/contrib/lite/testing/generated_examples_zip_test.cc1
3 files changed, 35 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/testing/BUILD b/tensorflow/contrib/lite/testing/BUILD
index 2c226e76d4..bd888a415b 100644
--- a/tensorflow/contrib/lite/testing/BUILD
+++ b/tensorflow/contrib/lite/testing/BUILD
@@ -34,6 +34,7 @@ gen_zipped_test_files(
"global_batch_norm.zip",
"l2_pool.zip",
"l2norm.zip",
+ "less.zip",
"local_response_norm.zip",
"log_softmax.zip",
"max_pool.zip",
diff --git a/tensorflow/contrib/lite/testing/generate_examples.py b/tensorflow/contrib/lite/testing/generate_examples.py
index 4b4ccc0c37..53b41d2358 100644
--- a/tensorflow/contrib/lite/testing/generate_examples.py
+++ b/tensorflow/contrib/lite/testing/generate_examples.py
@@ -1997,6 +1997,39 @@ def make_arg_max_tests(zip_path):
make_zip_of_tests(zip_path, test_parameters, build_graph, build_inputs)
+def make_less_tests(zip_path):
+ """Make a set of tests to do less."""
+
+ test_parameters = [{
+ "input_dtype": [tf.float32, tf.int32, tf.int64],
+ "input_shape_pair": [([1, 1, 1, 3], [1, 1, 1, 3]),
+ ([2, 3, 4, 5], [2, 3, 4, 5]), ([2, 3, 3], [2, 3]),
+ ([5, 5], [1]), ([10], [2, 4, 10])],
+ }]
+
+ def build_graph(parameters):
+ """Build the less op testing graph."""
+ input_value1 = tf.placeholder(
+ dtype=parameters["input_dtype"],
+ name="input1",
+ shape=parameters["input_shape_pair"][0])
+ input_value2 = tf.placeholder(
+ dtype=parameters["input_dtype"],
+ name="input2",
+ shape=parameters["input_shape_pair"][1])
+ out = tf.less(input_value1, input_value2)
+ return [input_value1, input_value2], [out]
+
+ def build_inputs(parameters, sess, inputs, outputs):
+ input_value1 = create_tensor_data(parameters["input_dtype"],
+ parameters["input_shape_pair"][0])
+ input_value2 = create_tensor_data(parameters["input_dtype"],
+ parameters["input_shape_pair"][1])
+ return [input_value1, input_value2], sess.run(
+ outputs, feed_dict=dict(zip(inputs, [input_value1, input_value2])))
+
+ make_zip_of_tests(zip_path, test_parameters, build_graph, build_inputs)
+
# Toco binary path provided by the generate rule.
bin_path = None
diff --git a/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc b/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc
index 84ae1d58fe..9da8bd7a28 100644
--- a/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc
+++ b/tensorflow/contrib/lite/testing/generated_examples_zip_test.cc
@@ -280,6 +280,7 @@ INSTANTIATE_TESTS(squeeze)
INSTANTIATE_TESTS(strided_slice)
INSTANTIATE_TESTS(sub)
INSTANTIATE_TESTS(transpose)
+INSTANTIATE_TESTS(less)
} // namespace testing
} // namespace tflite