Backends/SiaNet.Backend.MxNet/Interop/MXNet/CApi.cs
/// <summary>
/// create a NDArray with specified shape
/// </summary>
/// <param name="shape">the pointer to the shape</param>
/// <param name="ndim">the dimension of the shape</param>
/// <param name="dev_type">device type, specify device we want to take</param>
/// <param name="dev_id">the device id of the specific device</param>
/// <param name="delay_alloc">whether to delay allocation until the narray is first mutated</param>
/// <param name="@out">the returning handle</param>
/// <returns>0 when success, -1 when failure happens</returns>
create a NDArray with specified shape
create a NDArray with specified shape
[DllImport(NativeLibrary, CallingConvention = CallingConvention)]
        public static extern int MXNDArrayCreate(mx_uint[] shape,
                                                 mx_uint ndim,
                                                 int dev_type,
                                                 int dev_id,
                                                 int delay_alloc,
                                                 out NDArrayHandle @out);
[ DllImport ( NativeLibrary , CallingConvention = CallingConvention ) ] public static extern int MXNDArrayCreate ( mx_uint [ ] shape , mx_uint ndim , int dev_type , int dev_id , int delay_alloc , out NDArrayHandle @out ) ;
create a NDArray with specified shape
create a NDArray with specified shape
0 when success, -1 when failure happens
0 when success - 1 when failure happens
shape
mx_uint[]
the pointer to the shape
the pointer to the shape
ndim
mx_uint
the dimension of the shape
the dimension of the shape
dev_type
int
device type, specify device we want to take
device type specify device we want to take
dev_id
int
the device id of the specific device
the device id of the specific device
delay_alloc
int
whether to delay allocation until the narray is first mutated
whether to delay allocation until the narray is first mutated
NDArrayHandle
out
@out
the returning handle
the returning handle