summaryrefslogtreecommitdiff
path: root/compiler/luci/pass/src/QuantizationUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/luci/pass/src/QuantizationUtils.h')
-rw-r--r--compiler/luci/pass/src/QuantizationUtils.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/luci/pass/src/QuantizationUtils.h b/compiler/luci/pass/src/QuantizationUtils.h
index cd8cec95a..4d5316ccb 100644
--- a/compiler/luci/pass/src/QuantizationUtils.h
+++ b/compiler/luci/pass/src/QuantizationUtils.h
@@ -62,15 +62,19 @@ bool is_quantized(const CircleNode *node);
enum ActivationQType
{
- MinMax, // Quantize using recorded min/max
- PreDefinedValue, // Quantize using pre-defined values
- IntScale, // Round scale to a positive integer
+ MinMax, // Quantize using recorded min/max
+ PreDefinedLogistic, // Quantize using pre-defined values
+ PreDefinedTanh, // Quantize using pre-defined values
+ PreDefinedSoftmax, // Quantize using pre-defined values
+ IntScale, // Round scale to a positive integer
};
ActivationQType activation_qtype(const CircleNode *node);
// Create qparam with pre-defined values for speical operators
-std::unique_ptr<CircleQuantParam> make_predefined_qparam(CircleOpcode opcode, loco::DataType dtype);
+std::unique_ptr<CircleQuantParam> make_predefined_qparam(CircleNode *node, loco::DataType dtype);
+std::unique_ptr<CircleQuantParam> make_predefined_qparam(ActivationQType qtype,
+ loco::DataType dtype);
// Update node's scale to a positive integer (for special Ops e.g., Floor, Ceil)
void set_int_scale(luci::CircleNode *node);
@@ -78,6 +82,10 @@ void set_int_scale(luci::CircleNode *node);
// Quantize const tensor using its min/max values
void quant_const(luci::CircleConst *node, loco::DataType quant_type);
+// Check that a node is quantized without significant loss of precision;
+// Emits warnings to log with WARN
+void warn_accuracy_with_range(luci::CircleNode *n);
+
} // namespace luci
#endif // __LUCI_QUANTIZATION_UTILS_H__