Addressed review comments.
Change-Id: Ifefd7825025eedda29c1fc5baf7a14b5f0acae09
This commit is contained in:
parent
47735cb347
commit
a0338d6505
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user