Add quantize tests for activation op: sigmoid(aka logistic).
PiperOrigin-RevId: 276762422 Change-Id: I79303dbdb19178e144a673fa0ae87ba58147ee2c
This commit is contained in:
parent
e461fa5725
commit
5f26a30df1
@ -495,6 +495,7 @@ edgetpu_ops = [
|
|||||||
"pad", # high error
|
"pad", # high error
|
||||||
"reshape",
|
"reshape",
|
||||||
"resize_bilinear",
|
"resize_bilinear",
|
||||||
|
"sigmoid",
|
||||||
"slice",
|
"slice",
|
||||||
"softmax",
|
"softmax",
|
||||||
"space_to_depth",
|
"space_to_depth",
|
||||||
|
@ -30,6 +30,8 @@ def make_sigmoid_tests(options):
|
|||||||
test_parameters = [{
|
test_parameters = [{
|
||||||
"dtype": [tf.float32],
|
"dtype": [tf.float32],
|
||||||
"input_shape": [[1, 3, 4, 3], [4], [], [1, 2, 3, 4, 5, 6]],
|
"input_shape": [[1, 3, 4, 3], [4], [], [1, 2, 3, 4, 5, 6]],
|
||||||
|
"fully_quantize": [True, False],
|
||||||
|
"input_range": [(-10, 10)],
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def build_graph(parameters):
|
def build_graph(parameters):
|
||||||
@ -41,8 +43,10 @@ def make_sigmoid_tests(options):
|
|||||||
return [input_tensor], [out]
|
return [input_tensor], [out]
|
||||||
|
|
||||||
def build_inputs(parameters, sess, inputs, outputs):
|
def build_inputs(parameters, sess, inputs, outputs):
|
||||||
|
min_value, max_value = parameters["input_range"]
|
||||||
input_values = create_tensor_data(parameters["dtype"],
|
input_values = create_tensor_data(parameters["dtype"],
|
||||||
parameters["input_shape"])
|
parameters["input_shape"], min_value,
|
||||||
|
max_value)
|
||||||
return [input_values], sess.run(
|
return [input_values], sess.run(
|
||||||
outputs, feed_dict=dict(zip(inputs, [input_values])))
|
outputs, feed_dict=dict(zip(inputs, [input_values])))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user