Skip to content

Commit

Permalink
Fix bugs caused by ctypes (apache#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Junru Shao authored and zheng-da committed Jun 28, 2018
1 parent e2f814d commit 535b9c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/mxnet/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*!
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/symbol/contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/c_api/c_api_symbolic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<nnvm::Symbol*>(sym);
nnvm::Graph g;
Expand All @@ -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();
}

Expand Down

0 comments on commit 535b9c7

Please sign in to comment.