c++学习2

来源:互联网 发布:砂浆拉伸粘结强度数据 编辑:程序博客网 时间:2024/05/22 06:30

code :newBrain

定义dtype#define dtype floattypedef  unsigned int  uint;typedef  unsigned char  uchar;typedef struct{    dtype* data;    uint b;    uint c;    uint h;    uint w;}BLOB4;在一个结构里面定义函数指针> typedef void*(*FUNCTION)(void*);> FUNCTION run;> int (*forward)(struct Layer*);typedef struct layer Layer;typedef struct{    char* name;    LayerType type;    FUNCTION forward;    Weight* weight;    BLOB4* output;    BLOB4* input;}Layer;typedef struct WEIGHT{    dtype *weight;    dtype *bias;#ifdef USE_GPU    cldata* gpu;#endif      uint out_c;    uint in_c;    uint k_h;    uint k_w;}Weight;