Add int4/uint4 definition (#638)

This commit is contained in:
xie-oritek 2023-08-22 17:37:38 +08:00 committed by GitHub
parent 54af5c2216
commit 265e74ff16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,8 @@ namespace vx {
enum class DataType { enum class DataType {
UNKNOWN, UNKNOWN,
INT4,
UINT4,
INT8, INT8,
UINT8, UINT8,
INT16, INT16,

View File

@ -27,6 +27,10 @@ namespace tim {
namespace vx { namespace vx {
vsi_nn_type_e TranslateDataType(DataType dtype) { vsi_nn_type_e TranslateDataType(DataType dtype) {
switch (dtype) { switch (dtype) {
case DataType::INT4:
return VSI_NN_TYPE_INT4;
case DataType::UINT4:
return VSI_NN_TYPE_UINT4;
case DataType::INT8: case DataType::INT8:
return VSI_NN_TYPE_INT8; return VSI_NN_TYPE_INT8;
case DataType::UINT8: case DataType::UINT8: