From fde8268f91b261a8d4e29a7531ced2c0c421fc9c Mon Sep 17 00:00:00 2001 From: nnn <27625496+nnn112358@users.noreply.github.com> Date: Wed, 19 Mar 2025 02:17:39 +0900 Subject: [PATCH] Update _axclrt.py After investigating the issue, I found that the current code directly assigns the C pointer returned from the AxcrustEngineGetOutputNameByIndex function to the name variable. This causes Python to display the raw C pointer address (e.g., ) instead of the actual string value. The proper solution involves a two-step process: First, store the C pointer in a variable named cffi_name Then, convert the C pointer to a string using axclrt_cffi.string() and decode it as a UTF-8 string with decode("utf-8") This modification ensures that C string pointers are properly converted to Python strings, allowing the correct names to appear in the output results. This approach is consistent with the method already used in the _get_inputs() method. Before change: axengine/_axclrt.py LineNo.279 name = axclrt_lib.axclrtEngineGetOutputNameByIndex(self._info[0], index) After change: axengine/_axclrt.py LineNo.279 cffi_name = axclrt_lib.axclrtEngineGetOutputNameByIndex(self._info[0], index) name = axclrt_cffi.string(cffi_name).decode("utf-8") --- axengine/_axclrt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/axengine/_axclrt.py b/axengine/_axclrt.py index 73a75d5..731186f 100644 --- a/axengine/_axclrt.py +++ b/axengine/_axclrt.py @@ -276,7 +276,8 @@ def _get_outputs(self): for group in range(self._shape_count): one_group_io = [] for index in range(axclrt_lib.axclrtEngineGetNumOutputs(self._info[0])): - name = axclrt_lib.axclrtEngineGetOutputNameByIndex(self._info[0], index) + cffi_name = axclrt_lib.axclrtEngineGetOutputNameByIndex(self._info[0], index) + name = axclrt_cffi.string(cffi_name).decode("utf-8") cffi_dtype = axclrt_cffi.new("axclrtEngineDataType *") ret = axclrt_lib.axclrtEngineGetOutputDataType(self._info[0], index, cffi_dtype)