Addressed review comments.

Change-Id: Ifefd7825025eedda29c1fc5baf7a14b5f0acae09
This commit is contained in:
Elena Zhelezina 2019-12-10 10:44:39 +00:00
parent 47735cb347
commit a0338d6505
4 changed files with 2 additions and 11 deletions

View File

@ -779,7 +779,6 @@ OperatorProperty GetOperatorProperty(const ModelT* model, int subgraph_index,
property.arbitrary_inputs = true;
property.outputs = {{0, {}}};
property.restrict_same_input_output_scale = true;
property.restrict_multiple_inputs_scale = true;
property.version = 2;
break;
case BuiltinOperator_PAD:

View File

@ -85,10 +85,6 @@ struct OperatorProperty {
// Force output to reuse the same scale and zero point of input.
bool restrict_same_input_output_scale = false;
// In the case of multiple inputs, requantize all inputs to have
// the same scale and zero point.
bool restrict_multiple_inputs_scale = false;
// Use same min of min and max of max for each group.
// Incompatable with restrict_same_input_output_scale and restricted_value.
// TODO(jianlijianli): make it compatible with other restrictions when there

View File

@ -300,8 +300,7 @@ TfLiteStatus ApplyConstraints(ModelT* model,
if (!property.quantizable) {
continue;
}
if ((!property.arbitrary_inputs &&
!property.restrict_multiple_inputs_scale) ||
if ((!property.arbitrary_inputs) ||
!property.restrict_same_input_output_scale) {
continue;
}
@ -385,8 +384,7 @@ bool ShouldRestrictSameInputOutputScale(
operator_property::OperatorProperty property) {
// Ops with multiple inputs (i.e. concat) gets restricted in ApplyConstraints.
return (!property.arbitrary_inputs &&
property.restrict_same_input_output_scale &&
!property.restrict_multiple_inputs_scale);
property.restrict_same_input_output_scale);
}
bool IsSubgraphInput(SubGraphT* subgraph, int32_t index) {

View File

@ -1256,13 +1256,11 @@ class QuantizeUnpackTest : public QuantizeModelTest {
};
TEST_F(QuantizeUnpackTest, VerifyUnpack) {
auto status = QuantizeModel(&builder_, &model_, &error_reporter_);
ASSERT_EQ(kTfLiteOk, status);
const auto subgraph = model_.subgraphs[0].get();
auto op = subgraph->operators[1].get();
auto float_graph = readonly_model_->subgraphs()->Get(0);