diff --git a/include/mxnet/c_api.h b/include/mxnet/c_api.h index afdd666765a5..9bac3f773688 100644 --- a/include/mxnet/c_api.h +++ b/include/mxnet/c_api.h @@ -1058,7 +1058,7 @@ MXNET_DLL int MXSymbolGetAtomicSymbolName(AtomicSymbolCreator creator, * \param outs The input symbols of the graph. * \param out_size the number of input symbols returned. */ -MXNET_DLL int MXSymbolGetInputSymbols(SymbolHandle sym, SymbolHandle **inputs, +MXNET_DLL int MXSymbolGetInputSymbols(SymbolHandle sym, SymbolHandle *inputs, int *input_size); /*! diff --git a/python/mxnet/symbol/contrib.py b/python/mxnet/symbol/contrib.py index c1a04a105d74..fd12c69af2b9 100644 --- a/python/mxnet/symbol/contrib.py +++ b/python/mxnet/symbol/contrib.py @@ -106,7 +106,7 @@ def _get_graph_inputs(subg): syms = [] for i in range(num_handles.value): - s = Symbol(handles[i]) + s = Symbol(SymbolHandle(handles[i])) syms.append(s) return syms diff --git a/src/c_api/c_api_symbolic.cc b/src/c_api/c_api_symbolic.cc index 61a111a5b0ff..6b53fc2083e9 100644 --- a/src/c_api/c_api_symbolic.cc +++ b/src/c_api/c_api_symbolic.cc @@ -344,7 +344,7 @@ int MXSymbolGetAtomicSymbolName(AtomicSymbolCreator creator, API_END(); } -int MXSymbolGetInputSymbols(SymbolHandle sym, SymbolHandle **input_arr, int *input_size) { +int MXSymbolGetInputSymbols(SymbolHandle sym, SymbolHandle *input_arr, int *input_size) { API_BEGIN(); nnvm::Symbol *s = static_cast(sym); nnvm::Graph g; @@ -366,7 +366,7 @@ int MXSymbolGetInputSymbols(SymbolHandle sym, SymbolHandle **input_arr, int *inp } CHECK(input_syms.size() <= max_input_size); *input_size = input_syms.size(); - memcpy(input_arr, input_syms.data(), sizeof(*input_arr) * input_syms.size()); + std::copy(input_syms.begin(), input_syms.end(), input_arr); API_END_HANDLE_ERROR(); }