提交 3da6c853 编写于 作者: H Helin Wang

use enum instead of define

上级 00d4d89a
......@@ -58,16 +58,18 @@ The selected trainer's call to `paddle_begin_init_params` will return with 1, an
## C Interface
```c
#define PADDLE_ELEMENT_TYPE_INT32 0
#define PADDLE_ELEMENT_TYPE_UINT32 1
#define PADDLE_ELEMENT_TYPE_INT64 2
#define PADDLE_ELEMENT_TYPE_UINT64 3
#define PADDLE_ELEMENT_TYPE_FLOAT32 4
#define PADDLE_ELEMENT_TYPE_FLOAT64 5
typedef enum {
PADDLE_ELEMENT_TYPE_INT32 = 0,
PADDLE_ELEMENT_TYPE_UINT32 = 1,
PADDLE_ELEMENT_TYPE_INT64 = 2,
PADDLE_ELEMENT_TYPE_UINT64 = 3,
PADDLE_ELEMENT_TYPE_FLOAT32 = 4,
PADDLE_ELEMENT_TYPE_FLOAT64 = 5,
} paddle_element_type;
typedef struct {
char* name;
int element_type;
paddle_element_type element_type;
void* content;
int content_len;
} paddle_parameter, paddle_gradient;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册