Searched refs:fakequant_op (Results 1 – 8 of 8) sorted by relevance
/external/tensorflow/tensorflow/lite/toco/graph_transformations/ |
D | remove_trivial_fake_quant.cc | 32 const FakeQuantOperator& fakequant_op) { in IsFakeQuantTrivial() argument 33 CHECK(fakequant_op.type == OperatorType::kFakeQuant); in IsFakeQuantTrivial() 35 if (!fakequant_op.minmax) { in IsFakeQuantTrivial() 42 auto* producing_op = GetOpWithOutput(model, fakequant_op.inputs[0]); in IsFakeQuantTrivial() 53 if (*fakequant_op.minmax == *producing_fakequant_op.minmax && in IsFakeQuantTrivial() 54 fakequant_op.num_bits == producing_fakequant_op.num_bits) { in IsFakeQuantTrivial() 57 LogName(fakequant_op), LogName(producing_fakequant_op)); in IsFakeQuantTrivial() 76 auto* fakequant_op = static_cast<FakeQuantOperator*>(op); in Run() local 78 if (!IsFakeQuantTrivial(this, *model, *fakequant_op)) { in Run() 79 AddMessageF("%s is not trivial", LogName(*fakequant_op)); in Run() [all …]
|
D | resolve_fake_quant_args_from_vars.cc | 37 auto* fakequant_op = static_cast<FakeQuantOperator*>(fakequant_base_op); in Run() local 39 if (fakequant_op->minmax) { in Run() 44 CHECK_EQ(fakequant_op->inputs.size(), 3); in Run() 48 if (!IsConstantParameterArray(*model, fakequant_op->inputs[i])) { in Run() 54 const auto& min_array = model->GetArray(fakequant_op->inputs[1]); in Run() 55 const auto& max_array = model->GetArray(fakequant_op->inputs[2]); in Run() 58 fakequant_op->minmax.reset(new MinMax); in Run() 59 MinMax& minmax = *fakequant_op->minmax; in Run() 64 LOG(WARNING) << "For " << LogName(*fakequant_op) << " the MinMax range " in Run() 77 DeleteArrayIfUnusedOutsideOfOp(fakequant_op->inputs[i], fakequant_op, in Run() [all …]
|
D | resolve_constant_fake_quant.cc | 72 const auto* fakequant_op = in Run() local 76 if (!fakequant_op->minmax) { in Run() 81 if (!IsConstantParameterArray(*model, fakequant_op->inputs[0])) { in Run() 85 const auto& input_array = model->GetArray(fakequant_op->inputs[0]); in Run() 90 if (!InferQuantizedDataTypeFromFakeQuant(*fakequant_op, in Run() 92 AddMessageF("Unsupported FakeQuant num_bits=%d", fakequant_op->num_bits); in Run() 96 AddMessageF("Resolving constant %s", LogName(*fakequant_op)); in Run() 98 auto& output_array = model->GetArray(fakequant_op->outputs[0]); in Run() 111 output_array.GetOrCreateMinMax() = *fakequant_op->minmax; in Run() 121 if (fakequant_op->narrow_range) { in Run() [all …]
|
D | drop_fake_quant.cc | 36 auto* fakequant_op = static_cast<FakeQuantOperator*>(fakequant_base_op); in Run() local 38 if (!fakequant_op->minmax) { in Run() 42 const auto& output_array = model->GetArray(fakequant_op->outputs[0]); in Run() 48 for (int i = 1, end = fakequant_op->inputs.size(); i < end; i++) { in Run() 49 if (CountOpsWithInput(*model, fakequant_op->inputs[i]) == 1) { in Run() 50 model->EraseArray(fakequant_op->inputs[i]); in Run() 53 fakequant_op->inputs.resize(1); in Run()
|
D | dequantize.cc | 152 auto* fakequant_op = new FakeQuantOperator; in DequantizeArray() local 154 fakequant_op); in DequantizeArray() 160 fakequant_op->minmax.reset(new MinMax); in DequantizeArray() 161 *fakequant_op->minmax = array->GetMinMax(); in DequantizeArray() 162 fakequant_op->narrow_range = array->narrow_range; in DequantizeArray() 171 fakequant_op->inputs = {new_array_name}; in DequantizeArray() 172 fakequant_op->outputs = {array_name}; in DequantizeArray() 181 fakequant_op->inputs = {array_name}; in DequantizeArray() 182 fakequant_op->outputs = {new_array_name}; in DequantizeArray()
|
D | propagate_fake_quant_num_bits.cc | 289 auto* fakequant_op = static_cast<FakeQuantOperator*>(op); in Run() local 292 if (!InferQuantizedDataTypeFromFakeQuant(*fakequant_op, in Run() 295 LogName(*op), fakequant_op->num_bits); in Run() 298 const auto& final_minmax = *fakequant_op->minmax; in Run() 302 LogName(*op), fakequant_op->num_bits, final_minmax.min, final_minmax.max, in Run()
|
/external/tensorflow/tensorflow/lite/toco/ |
D | dump_graphviz.cc | 398 const auto& fakequant_op = static_cast<const FakeQuantOperator&>(op); in GetOpAttributes() local 399 attrs["bits"] = StringF("%d", fakequant_op.num_bits); in GetOpAttributes() 400 if (fakequant_op.minmax) { in GetOpAttributes() 401 attrs["range"] = StringF("[%g,%g]", fakequant_op.minmax->min, in GetOpAttributes() 402 fakequant_op.minmax->max); in GetOpAttributes()
|
D | export_tensorflow.cc | 959 tensorflow::NodeDef* fakequant_op = tensorflow_graph->add_node(); in ConvertFakeQuantOperator() local 960 fakequant_op->set_op("FakeQuantWithMinMaxArgs"); in ConvertFakeQuantOperator() 961 fakequant_op->set_name(src_op.outputs[0]); in ConvertFakeQuantOperator() 963 *fakequant_op->add_input() = src_op.inputs[0]; in ConvertFakeQuantOperator() 965 (*fakequant_op->mutable_attr())["min"].set_f(src_op.minmax->min); in ConvertFakeQuantOperator() 966 (*fakequant_op->mutable_attr())["max"].set_f(src_op.minmax->max); in ConvertFakeQuantOperator() 968 (*fakequant_op->mutable_attr())["num_bits"].set_i(src_op.num_bits); in ConvertFakeQuantOperator() 971 (*fakequant_op->mutable_attr())["narrow_range"].set_b(src_op.narrow_range); in ConvertFakeQuantOperator() 2539 FakeQuantOperator* fakequant_op = new FakeQuantOperator; in EncodeConstantArraysMinMaxByWrappingThemInFakeQuantNodes() local 2540 fakequant_op->inputs = {wrapped_array_name}; in EncodeConstantArraysMinMaxByWrappingThemInFakeQuantNodes() [all …]
|