diff --git a/.travis.yml b/.travis.yml index 50536f32e84c..ec2aa8dab0a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ addons: - gcc-4.8 - g++-4.8 - clang + - python-numpy before_install: - export NVCC_PREFIX=${HOME} diff --git a/include/mxnet/c_api.h b/include/mxnet/c_api.h index 38132cb169a5..d194edb049c7 100644 --- a/include/mxnet/c_api.h +++ b/include/mxnet/c_api.h @@ -38,7 +38,7 @@ typedef void *AtomicSymbolHandle; typedef void *ExecutorHandle; /*! \brief handle to a DataIterator */ typedef void *DataIterHandle; -/* +/*! * \brief return str message of the last error * all function in this file will return 0 when success * and -1 when an error occured, @@ -389,6 +389,8 @@ MXNET_DLL int MXExecutorHeads(ExecutorHandle handle, * \brief Generate Executor from symbol * * \param symbol_handle symbol handle + * \param dev_mask device mask + * \param dev_id device id * \param len length * \param in_args in args array * \param arg_grad_store arg grads handle array diff --git a/include/mxnet/narray.h b/include/mxnet/narray.h index ed2b72bc4cc5..3202fd676cb7 100644 --- a/include/mxnet/narray.h +++ b/include/mxnet/narray.h @@ -138,7 +138,7 @@ class NArray { CHECK_GE(shape_[0], end) << "Chunk is smaller than required"; size_t length = 1; if (shape_.ndim() == 1) { - ret.offset_= begin; + ret.offset_ = begin; } else { for (index_t i = 1; i < shape_.ndim(); ++i) { length *= shape_[i]; diff --git a/python/mxnet/executor.py b/python/mxnet/executor.py index 7352bfe2f289..235c16c542f3 100644 --- a/python/mxnet/executor.py +++ b/python/mxnet/executor.py @@ -1,10 +1,11 @@ # coding: utf-8 +# pylint: disable=invalid-name, protected-access, too-many-locals, fixme """ code for executor. """ from __future__ import absolute_import import ctypes from .base import _LIB -from .base import c_array, c_str, mx_uint, NArrayHandle, ExecutorHandle +from .base import c_array, mx_uint, NArrayHandle, ExecutorHandle from .base import check_call from .narray import NArray 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.py b/python/mxnet/symbol.py index 6c72442cb3f9..b4f8cd1b7914 100644 --- a/python/mxnet/symbol.py +++ b/python/mxnet/symbol.py @@ -1,5 +1,5 @@ # coding: utf-8 -# pylint: disable=invalid-name, protected-access, too-many-locals +# pylint: disable=invalid-name, protected-access, too-many-locals, fixme """Symbol support of mxnet""" from __future__ import absolute_import @@ -7,7 +7,6 @@ from .base import _LIB from .base import c_array, c_str, mx_uint, NArrayHandle, ExecutorHandle, SymbolHandle from .base import check_call -from .narray import NArray from .context import Context from .executor import Executor 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): diff --git a/src/symbol/graph_executor.h b/src/symbol/graph_executor.h index a072eee69b68..d2bc84d0733d 100644 --- a/src/symbol/graph_executor.h +++ b/src/symbol/graph_executor.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include "./graph_memory_allocator.h"