aboutsummaryrefslogtreecommitdiff
path: root/src/TosaSerialize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/TosaSerialize.cpp')
-rw-r--r--src/TosaSerialize.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp
index 7ba4bf2..21c0f93 100644
--- a/src/TosaSerialize.cpp
+++ b/src/TosaSerialize.cpp
@@ -73,7 +73,7 @@ static ResizeMode ResizeModeStr2Enum(const std::string &mode_str) {
static DType Type2DType(mlir::Type element_type) {
if (element_type.isF64() || element_type.isF32() || element_type.isF16() ||
element_type.isBF16()) {
- return DType_FLOAT;
+ return DType_FP32;
} else if (element_type.isUnsignedInteger(8)) {
return DType_UINT8;
} else if (element_type.isInteger(4)) {
@@ -97,7 +97,7 @@ static DType Type2DType(mlir::Type element_type) {
static DType Type2AccumDType(mlir::Type element_type) {
if (element_type.isF64() || element_type.isF32() || element_type.isF16() ||
element_type.isBF16()) {
- return DType_FLOAT;
+ return DType_FP32;
} else if (element_type.isInteger(8)) {
return DType_INT32;
} else if (element_type.isInteger(16)) {
@@ -109,7 +109,7 @@ static DType Type2AccumDType(mlir::Type element_type) {
static DType Type2PoolAccumDType(mlir::Type element_type) {
if (element_type.isF64() || element_type.isF32() || element_type.isF16() ||
element_type.isBF16()) {
- return DType_FLOAT;
+ return DType_FP32;
} else if (element_type.isInteger(8) || element_type.isInteger(16)) {
return DType_INT32;
}
@@ -385,7 +385,7 @@ TosaSerializationOperatorBuilder::build<mlir::tosa::ConstOp>(
if (unit_val)
{
std::vector<float> data = { 0.0 };
- type = DType_FLOAT;
+ type = DType_FP32;
TosaSerializationHandler::ConvertF32toU8(data, u8_data);
}
#endif
@@ -393,7 +393,7 @@ TosaSerializationOperatorBuilder::build<mlir::tosa::ConstOp>(
// Update tensor.data array with Const value attribute
std::vector<uint8_t> u8_data;
DType type = ts->GetDtype();
- if (type == DType_FLOAT) {
+ if (type == DType_FP32) {
std::vector<float> data;
auto dense_attr = op.getAttr(llvm::StringRef("value"))
.dyn_cast<mlir::DenseElementsAttr>();