Add quantize tests for activation op: sigmoid(aka logistic).

PiperOrigin-RevId: 276762422
Change-Id: I79303dbdb19178e144a673fa0ae87ba58147ee2c
This commit is contained in:
A. Unique TensorFlower 2019-10-25 14:34:48 -07:00 committed by TensorFlower Gardener
parent e461fa5725
commit 5f26a30df1
2 changed files with 6 additions and 1 deletions

View File

@ -495,6 +495,7 @@ edgetpu_ops = [
"pad", # high error
"reshape",
"resize_bilinear",
"sigmoid",
"slice",
"softmax",
"space_to_depth",

View File

@ -30,6 +30,8 @@ def make_sigmoid_tests(options):
test_parameters = [{
"dtype": [tf.float32],
"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):
@ -41,8 +43,10 @@ def make_sigmoid_tests(options):
return [input_tensor], [out]
def build_inputs(parameters, sess, inputs, outputs):
min_value, max_value = parameters["input_range"]
input_values = create_tensor_data(parameters["dtype"],
parameters["input_shape"])
parameters["input_shape"], min_value,
max_value)
return [input_values], sess.run(
outputs, feed_dict=dict(zip(inputs, [input_values])))