Add dynamic range tests to relevant op_tests (letter C).
PiperOrigin-RevId: 316755889 Change-Id: If087d4bb5db715f2ccefa1aec15a89e9a915c5ad
This commit is contained in:
parent
295ee8ab72
commit
389405a779
|
@ -32,13 +32,22 @@ def make_concat_tests(options):
|
||||||
"num_tensors": [1, 2, 3, 4, 5, 6],
|
"num_tensors": [1, 2, 3, 4, 5, 6],
|
||||||
"axis": [0, 1, 2, 3, -3, -2, -1],
|
"axis": [0, 1, 2, 3, -3, -2, -1],
|
||||||
"type": [tf.float32, tf.uint8, tf.int32, tf.int64],
|
"type": [tf.float32, tf.uint8, tf.int32, tf.int64],
|
||||||
"fully_quantize": [False]
|
"fully_quantize": [False],
|
||||||
|
"dynamic_range_quantize": [False],
|
||||||
}, {
|
}, {
|
||||||
"base_shape": [[1, 3, 4, 3], [3, 4], [2, 3, 4, 3]],
|
"base_shape": [[1, 3, 4, 3], [3, 4], [2, 3, 4, 3]],
|
||||||
"num_tensors": [1, 2, 3, 4, 5, 6],
|
"num_tensors": [1, 2, 3, 4, 5, 6],
|
||||||
"axis": [1, 2, 3, -3, -2, -1],
|
"axis": [1, 2, 3, -3, -2, -1],
|
||||||
"type": [tf.float32],
|
"type": [tf.float32],
|
||||||
"fully_quantize": [True]
|
"fully_quantize": [True],
|
||||||
|
"dynamic_range_quantize": [False],
|
||||||
|
}, {
|
||||||
|
"base_shape": [[1, 3, 4, 3]],
|
||||||
|
"num_tensors": [6],
|
||||||
|
"axis": [1],
|
||||||
|
"type": [tf.float32],
|
||||||
|
"fully_quantize": [False],
|
||||||
|
"dynamic_range_quantize": [True],
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def get_shape(parameters, delta):
|
def get_shape(parameters, delta):
|
||||||
|
|
|
@ -39,6 +39,7 @@ def make_conv_tests(options):
|
||||||
"constant_filter": [True, False],
|
"constant_filter": [True, False],
|
||||||
"channel_multiplier": [1, 2],
|
"channel_multiplier": [1, 2],
|
||||||
"fully_quantize": [False],
|
"fully_quantize": [False],
|
||||||
|
"dynamic_range_quantize": [False],
|
||||||
},
|
},
|
||||||
# TODO(b/134702301): The fully_quantize param is just ignored by the MLIR
|
# TODO(b/134702301): The fully_quantize param is just ignored by the MLIR
|
||||||
# testing path now, resulting in duplicate tests. Either ignore these
|
# testing path now, resulting in duplicate tests. Either ignore these
|
||||||
|
@ -53,7 +54,20 @@ def make_conv_tests(options):
|
||||||
"constant_filter": [True],
|
"constant_filter": [True],
|
||||||
"channel_multiplier": [1, 2],
|
"channel_multiplier": [1, 2],
|
||||||
"fully_quantize": [True],
|
"fully_quantize": [True],
|
||||||
}
|
"dynamic_range_quantize": [False],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input_shape": [[1, 3, 4, 3]],
|
||||||
|
"filter_shape": [[1, 1]],
|
||||||
|
"strides": [[1, 1, 1, 1], [1, 2, 3, 1]],
|
||||||
|
"dilations": [[1, 1, 1, 1]],
|
||||||
|
"padding": ["SAME", "VALID"],
|
||||||
|
"data_format": ["NHWC"],
|
||||||
|
"constant_filter": [True],
|
||||||
|
"channel_multiplier": [2],
|
||||||
|
"fully_quantize": [False],
|
||||||
|
"dynamic_range_quantize": [True],
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_tensor_shapes(parameters):
|
def get_tensor_shapes(parameters):
|
||||||
|
|
|
@ -40,6 +40,7 @@ def make_conv_activation_tests(activation_op):
|
||||||
"constant_filter": [True, False],
|
"constant_filter": [True, False],
|
||||||
"channel_multiplier": [1, 2],
|
"channel_multiplier": [1, 2],
|
||||||
"fully_quantize": [False],
|
"fully_quantize": [False],
|
||||||
|
"dynamic_range_quantize": [False],
|
||||||
},
|
},
|
||||||
# TODO(b/134702301): The fully_quantize param is just ignored by the
|
# TODO(b/134702301): The fully_quantize param is just ignored by the
|
||||||
# MLIR testing path now, resulting in duplicate tests. Either ignore
|
# MLIR testing path now, resulting in duplicate tests. Either ignore
|
||||||
|
@ -54,7 +55,20 @@ def make_conv_activation_tests(activation_op):
|
||||||
"constant_filter": [True],
|
"constant_filter": [True],
|
||||||
"channel_multiplier": [1, 2],
|
"channel_multiplier": [1, 2],
|
||||||
"fully_quantize": [True],
|
"fully_quantize": [True],
|
||||||
}
|
"dynamic_range_quantize": [False],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"input_shape": [[1, 3, 4, 3]],
|
||||||
|
"filter_shape": [[1, 1], [2, 3], [3, 3]],
|
||||||
|
"strides": [[1, 1, 1, 1], [1, 2, 3, 1]],
|
||||||
|
"dilations": [[1, 1, 1, 1]],
|
||||||
|
"padding": ["SAME", "VALID"],
|
||||||
|
"data_format": ["NHWC"],
|
||||||
|
"constant_filter": [True],
|
||||||
|
"channel_multiplier": [1, 2],
|
||||||
|
"fully_quantize": [False],
|
||||||
|
"dynamic_range_quantize": [True],
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_tensor_shapes(parameters):
|
def get_tensor_shapes(parameters):
|
||||||
|
|
|
@ -36,6 +36,7 @@ def make_conv_with_shared_weights_tests(options):
|
||||||
"padding": ["SAME"],
|
"padding": ["SAME"],
|
||||||
"data_format": ["NHWC"],
|
"data_format": ["NHWC"],
|
||||||
"channel_multiplier": [1],
|
"channel_multiplier": [1],
|
||||||
|
"dynamic_range_quantize": [False, True],
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def get_tensor_shapes(parameters):
|
def get_tensor_shapes(parameters):
|
||||||
|
|
Loading…
Reference in New Issue