From 72eb074802c4417b58aa0e883e6f19a81d76f567 Mon Sep 17 00:00:00 2001 From: linmin Date: Thu, 20 Aug 2015 22:30:29 +0800 Subject: [PATCH] fix python call bug --- python/mxnet/function.py | 2 +- python/mxnet/symbol_creator.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/mxnet/function.py b/python/mxnet/function.py index 807e50e55368..9903be604d6c 100644 --- a/python/mxnet/function.py +++ b/python/mxnet/function.py @@ -124,7 +124,7 @@ def __init__(self): ctypes.byref(plist))) hmap = {} for i in range(size.value): - hdl = plist[i] + hdl = ctypes.c_void_p(plist[i]) name = ctypes.c_char_p() check_call(_LIB.MXFuncGetName(hdl, ctypes.byref(name))) hmap[name.value] = _Function(hdl, name.value) diff --git a/python/mxnet/symbol_creator.py b/python/mxnet/symbol_creator.py index d507a9c2871a..bcadbe7daacb 100644 --- a/python/mxnet/symbol_creator.py +++ b/python/mxnet/symbol_creator.py @@ -83,9 +83,10 @@ def __init__(self): ctypes.byref(plist))) hmap = {} for i in range(size.value): + hdl = ctypes.c_void_p(plist[i]) name = ctypes.c_char_p() - check_call(_LIB.MXSymbolGetAtomicSymbolName(plist[i], ctypes.byref(name))) - hmap[name.value] = _SymbolCreator(name, plist[i]) + check_call(_LIB.MXSymbolGetAtomicSymbolName(hdl, ctypes.byref(name))) + hmap[name.value] = _SymbolCreator(name, hdl) self.__dict__.update(hmap) def Variable(self, name):