diff --git a/src/serialization/impl/extern_c_opr.cpp b/src/serialization/impl/extern_c_opr.cpp index f4f2a4e3..f78a4130 100644 --- a/src/serialization/impl/extern_c_opr.cpp +++ b/src/serialization/impl/extern_c_opr.cpp @@ -59,6 +59,8 @@ MGBDType dtype_cpp2c(DType dtype) { return MGB_DTYPE_FLOAT32; case DTypeEnum::Int32: return MGB_DTYPE_INT32; + case DTypeEnum::Int16: + return MGB_DTYPE_INT16; case DTypeEnum::Uint8: return MGB_DTYPE_UINT8; #if !MEGDNN_DISABLE_FLOAT16 @@ -75,6 +77,8 @@ DType dtype_c2cpp(MGBDType dtype) { switch (dtype) { case MGB_DTYPE_UINT8: return dtype::Uint8{}; + case MGB_DTYPE_INT16: + return dtype::Int16{}; case MGB_DTYPE_INT32: return dtype::Int32{}; case MGB_DTYPE_FLOAT32: diff --git a/src/serialization/include/megbrain/serialization/extern_c_opr.h b/src/serialization/include/megbrain/serialization/extern_c_opr.h index 8967c507..9795cc87 100644 --- a/src/serialization/include/megbrain/serialization/extern_c_opr.h +++ b/src/serialization/include/megbrain/serialization/extern_c_opr.h @@ -36,6 +36,7 @@ typedef enum MGBDType { MGB_DTYPE_UINT8, //! IEEE 754-based half-precision floating MGB_DTYPE_FLOAT16, + MGB_DTYPE_INT16, } MGBDType; typedef struct MGBTensorShape {