Backends/SiaNet.Backend.MxNet/Interop/MXNet/CApi.cs
/// <summary>
/// invoke a nnvm op and imperative function
/// </summary>
/// <param name="creator">the op</param>
/// <param name="num_inputs">number of input NDArrays</param>
/// <param name="inputs">input NDArrays</param>
/// <param name="num_outputs">number of output NDArrays</param>
/// <param name="outputs">output NDArrays</param>
/// <param name="num_params">number of keyword parameters</param>
/// <param name="param_keys">keys for keyword parameters</param>
/// <param name="param_vals">values for keyword parameters</param>
/// <returns>0 when success, -1 when failure happens</returns>
invoke a nnvm op and imperative function
invoke a nnvm op and imperative function
[DllImport(NativeLibrary, CallingConvention = CallingConvention)]
        public static extern int MXImperativeInvoke(AtomicSymbolCreator creator,
                                                    int num_inputs,
                                                    NDArrayHandle[] inputs,
                                                    ref int num_outputs,
                                                    ref NDArrayHandle[] outputs,
                                                    int num_params,
                                                    [In][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] param_keys,
                                                    [In][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] param_vals);
[ DllImport ( NativeLibrary , CallingConvention = CallingConvention ) ] public static extern int MXImperativeInvoke ( AtomicSymbolCreator creator , int num_inputs , NDArrayHandle [ ] inputs , ref int num_outputs , ref NDArrayHandle [ ] outputs , int num_params , [ In ] [ MarshalAs ( UnmanagedType . LPArray , ArraySubType = UnmanagedType . LPStr ) ] string [ ] param_keys , [ In ] [ MarshalAs ( UnmanagedType . LPArray , ArraySubType = UnmanagedType . LPStr ) ] string [ ] param_vals ) ;
invoke a nnvm op and imperative function
invoke a nnvm op and imperative function
0 when success, -1 when failure happens
0 when success - 1 when failure happens
creator
AtomicSymbolCreator
None
num_inputs
int
number of input NDArrays
number of input NDArrays
inputs
NDArrayHandle[]
None
int
ref
NDArrayHandle[]
ref
num_params
int
number of keyword parameters
number of keyword parameters
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)]
[In]
num_outputs
number of output NDArrays
number of output NDArrays
outputs
None
param_keys
keys for keyword parameters
keys for keyword parameters
param_vals
values for keyword parameters
values for keyword parameters