Create a gist now

Instantly share code, notes, and snippets.

@chyanju /pMXNet_1.jl Secret
Last active Jan 18, 2016

What would you like to do?
A Piece of Code from MXNet.jl
"Utility macro to call MXNet API functions"
macro mxcall(fv, argtypes, args...)
f = eval(fv)
args = map(esc, args)
quote
_mxret = ccall( ($(Meta.quot(f)), $MXNET_LIB),
Cint, $argtypes, $(args...) )
if _mxret != 0
err_msg = mx_get_last_error()
throw(MXError(err_msg))
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment