diff --git a/runtime/onert/api/python/include/nnfw_api_wrapper.h b/runtime/onert/api/python/include/nnfw_api_wrapper.h index 1160806ddf9..6db0c118ead 100644 --- a/runtime/onert/api/python/include/nnfw_api_wrapper.h +++ b/runtime/onert/api/python/include/nnfw_api_wrapper.h @@ -17,6 +17,8 @@ #ifndef __ONERT_API_PYTHON_NNFW_API_WRAPPER_H__ #define __ONERT_API_PYTHON_NNFW_API_WRAPPER_H__ +#include + #include "nnfw.h" #include "nnfw_experimental.h" #include "nnfw_internal.h" @@ -48,7 +50,7 @@ namespace py = pybind11; struct tensorinfo { /** The data type */ - const char *dtype; + std::string dtype; /** The number of dimensions (rank) */ int32_t rank; /** diff --git a/runtime/onert/api/python/src/wrapper/nnfw_api_wrapper.cc b/runtime/onert/api/python/src/wrapper/nnfw_api_wrapper.cc index 2a3c6c271a4..2d660223d59 100644 --- a/runtime/onert/api/python/src/wrapper/nnfw_api_wrapper.cc +++ b/runtime/onert/api/python/src/wrapper/nnfw_api_wrapper.cc @@ -156,7 +156,7 @@ void NNFW_SESSION::close_session() void NNFW_SESSION::set_input_tensorinfo(uint32_t index, const tensorinfo *tensor_info) { nnfw_tensorinfo ti; - ti.dtype = getType(tensor_info->dtype); + ti.dtype = getType(tensor_info->dtype.c_str()); ti.rank = tensor_info->rank; for (int i = 0; i < NNFW_MAX_RANK; i++) {