From f4cc504f2a911c0fb74ad5b86ef96bf8eb99e420 Mon Sep 17 00:00:00 2001 From: nhzlx Date: Fri, 21 Jun 2019 05:40:32 +0000 Subject: [PATCH] fix gencode bug: add kInt32 type to PrecisoinPepr --- paddle/fluid/lite/core/target_wrapper.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/lite/core/target_wrapper.h b/paddle/fluid/lite/core/target_wrapper.h index 858ce65853e..66fbc652203 100644 --- a/paddle/fluid/lite/core/target_wrapper.h +++ b/paddle/fluid/lite/core/target_wrapper.h @@ -55,6 +55,8 @@ static size_t PrecisionTypeLength(PrecisionType type) { return 4; case PrecisionType::kInt8: return 1; + case PrecisionType::kInt32: + return 4; default: return 4; } @@ -99,7 +101,7 @@ static const std::string& TargetRepr(TargetType target) { static const std::string& PrecisionRepr(PrecisionType precision) { static const std::string precision2string[] = {"kUnk", "kFloat", "kInt8", - "kAny"}; + "kInt32", "kAny"}; auto x = static_cast(precision); CHECK_LT(x, static_cast(PRECISION(NUM))); return precision2string[x]; -- GitLab