Add dynamic range test to op_tests A-B.

PiperOrigin-RevId: 316748721
Change-Id: I2e803777a160197f3b7a6026c5e94ce11f47ab92
This commit is contained in:
Suharsh Sivakumar 2020-06-16 13:38:34 -07:00 committed by TensorFlower Gardener
parent 10d5e26a90
commit 8cf2895fcc
4 changed files with 69 additions and 1 deletions

View File

@ -32,16 +32,25 @@ def make_add_n_tests(options):
"dtype": [tf.float32, tf.int32], "dtype": [tf.float32, tf.int32],
"input_shape": [[2, 5, 3, 1]], "input_shape": [[2, 5, 3, 1]],
"num_inputs": [2, 3, 4, 5], "num_inputs": [2, 3, 4, 5],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32, tf.int32], "dtype": [tf.float32, tf.int32],
"input_shape": [[5]], "input_shape": [[5]],
"num_inputs": [2, 3, 4, 5], "num_inputs": [2, 3, 4, 5],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32, tf.int32], "dtype": [tf.float32, tf.int32],
"input_shape": [[]], "input_shape": [[]],
"num_inputs": [2, 3, 4, 5], "num_inputs": [2, 3, 4, 5],
"dynamic_range_quantize": [False],
},
{
"dtype": [tf.float32],
"input_shape": [[]],
"num_inputs": [2, 3, 4, 5],
"dynamic_range_quantize": [True],
}, },
] ]

View File

@ -34,6 +34,7 @@ def make_arg_min_max_tests(options):
"input_shape": [[], [1, 1, 1, 3], [2, 3, 4, 5], [2, 3, 3], [5, 5], [10]], "input_shape": [[], [1, 1, 1, 3], [2, 3, 4, 5], [2, 3, 3], [5, 5], [10]],
"output_type": [tf.int32, tf.int64], "output_type": [tf.int32, tf.int64],
"is_arg_max": [True], "is_arg_max": [True],
"dynamic_range_quantize": [False, True],
}] }]
def build_graph(parameters): def build_graph(parameters):
@ -62,4 +63,4 @@ def make_arg_min_max_tests(options):
test_parameters, test_parameters,
build_graph, build_graph,
build_inputs, build_inputs,
expected_tf_failures=4) expected_tf_failures=8)

View File

@ -36,6 +36,7 @@ def make_batch_to_space_nd_tests(options):
"crops": [[[0, 0], [0, 0]], [[1, 1], [1, 1]]], "crops": [[[0, 0], [0, 0]], [[1, 1], [1, 1]]],
"constant_block_shape": [True, False], "constant_block_shape": [True, False],
"constant_crops": [True, False], "constant_crops": [True, False],
"dynamic_range_quantize": [False],
}, },
# Single batch (no-op) # Single batch (no-op)
{ {
@ -45,6 +46,7 @@ def make_batch_to_space_nd_tests(options):
"crops": [[[0, 0], [0, 0]], [[1, 1], [1, 1]]], "crops": [[[0, 0], [0, 0]], [[1, 1], [1, 1]]],
"constant_block_shape": [True], "constant_block_shape": [True],
"constant_crops": [True], "constant_crops": [True],
"dynamic_range_quantize": [True, False],
}, },
# 3D use case. # 3D use case.
{ {
@ -54,6 +56,7 @@ def make_batch_to_space_nd_tests(options):
"crops": [[[0, 0]], [[1, 1]]], "crops": [[[0, 0]], [[1, 1]]],
"constant_block_shape": [True], "constant_block_shape": [True],
"constant_crops": [True], "constant_crops": [True],
"dynamic_range_quantize": [True, False],
}, },
] ]
@ -66,6 +69,7 @@ def make_batch_to_space_nd_tests(options):
"crops": [[[0, 0], [0, 0], [0, 0]]], "crops": [[[0, 0], [0, 0], [0, 0]]],
"constant_block_shape": [True, False], "constant_block_shape": [True, False],
"constant_crops": [True, False], "constant_crops": [True, False],
"dynamic_range_quantize": [False],
}] }]
def build_graph(parameters): def build_graph(parameters):

View File

@ -41,6 +41,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[1, 3, 4, 3]], "input_shape_2": [[1, 3, 4, 3]],
"activation": [True], "activation": [True],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -48,6 +49,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[5]], "input_shape_2": [[5]],
"activation": [False, True], "activation": [False, True],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32, tf.int32, tf.int64], "dtype": [tf.float32, tf.int32, tf.int64],
@ -55,6 +57,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[3]], "input_shape_2": [[3]],
"activation": [True, False], "activation": [True, False],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32, tf.int32], "dtype": [tf.float32, tf.int32],
@ -62,6 +65,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[1, 3, 4, 3]], "input_shape_2": [[1, 3, 4, 3]],
"activation": [True, False], "activation": [True, False],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -69,6 +73,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[]], "input_shape_2": [[]],
"activation": [False], "activation": [False],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -76,6 +81,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[1]], "input_shape_2": [[1]],
"activation": [False], "activation": [False],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -83,6 +89,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[1, 3, 4, 3]], "input_shape_2": [[1, 3, 4, 3]],
"activation": [False], "activation": [False],
"fully_quantize": [True], "fully_quantize": [True],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -90,6 +97,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[5]], "input_shape_2": [[5]],
"activation": [False], "activation": [False],
"fully_quantize": [True], "fully_quantize": [True],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -97,6 +105,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[3]], "input_shape_2": [[3]],
"activation": [False], "activation": [False],
"fully_quantize": [True], "fully_quantize": [True],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -104,6 +113,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[1, 3, 4, 3]], "input_shape_2": [[1, 3, 4, 3]],
"activation": [False], "activation": [False],
"fully_quantize": [True], "fully_quantize": [True],
"dynamic_range_quantize": [False],
}, },
{ {
"dtype": [tf.float32], "dtype": [tf.float32],
@ -111,6 +121,47 @@ def make_binary_op_tests(options,
"input_shape_2": [[]], "input_shape_2": [[]],
"activation": [False], "activation": [False],
"fully_quantize": [True], "fully_quantize": [True],
"dynamic_range_quantize": [False],
},
{
"dtype": [tf.float32],
"input_shape_1": [[1, 3, 4, 3]],
"input_shape_2": [[1, 3, 4, 3]],
"activation": [False],
"fully_quantize": [False],
"dynamic_range_quantize": [True],
},
{
"dtype": [tf.float32],
"input_shape_1": [[5]],
"input_shape_2": [[5]],
"activation": [False],
"fully_quantize": [False],
"dynamic_range_quantize": [True],
},
{
"dtype": [tf.float32],
"input_shape_1": [[1, 3, 4, 3]],
"input_shape_2": [[3]],
"activation": [False],
"fully_quantize": [False],
"dynamic_range_quantize": [True],
},
{
"dtype": [tf.float32],
"input_shape_1": [[3]],
"input_shape_2": [[1, 3, 4, 3]],
"activation": [False],
"fully_quantize": [False],
"dynamic_range_quantize": [True],
},
{
"dtype": [tf.float32],
"input_shape_1": [[]],
"input_shape_2": [[]],
"activation": [False],
"fully_quantize": [False],
"dynamic_range_quantize": [True],
}, },
] ]
@ -123,6 +174,7 @@ def make_binary_op_tests(options,
"input_shape_2": [[7]], "input_shape_2": [[7]],
"activation": [False], "activation": [False],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False],
}, },
] ]
@ -204,6 +256,7 @@ def make_div_tests(options):
"input_shape_2": [[3]], "input_shape_2": [[3]],
"activation": [False], "activation": [False],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False, True],
}, },
] ]
make_binary_op_tests( make_binary_op_tests(
@ -220,6 +273,7 @@ def make_sub_tests(options):
"input_shape_2": [[3]], "input_shape_2": [[3]],
"activation": [False], "activation": [False],
"fully_quantize": [False], "fully_quantize": [False],
"dynamic_range_quantize": [False, True],
}, },
] ]
make_binary_op_tests( make_binary_op_tests(