Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用capi时,有多个slot时,in_args怎么用 #3552

Closed
shell-no-shell opened this issue Aug 17, 2017 · 3 comments
Closed

调用capi时,有多个slot时,in_args怎么用 #3552

shell-no-shell opened this issue Aug 17, 2017 · 3 comments
Labels
duplicate User 用于标记用户问题

Comments

@shell-no-shell
Copy link

麻烦问一下,训练模型的时候,使用了不同的type,使用paddle的capi加载模型预测时,in_args怎么用,
nid是[0,0,1.....]one-hot格式的,长度少于500
nid = paddle.layer.data(name='nid', type=paddle.data_type.sparse_binary_vector(500))
sub_time = paddle.layer.data(name='sub_time', type=paddle.data_type.dense_vector(1))

@qingqing01
Copy link
Contributor

另外in_args没有描述清楚,不了解的同学,根本不知道在说啥~

@qingqing01
Copy link
Contributor

paddle_arguments在设置时,有个Index,用来表示slot id,代码: https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/capi/arguments.h#L75

多个slot(或feature)时,使用同一个paddle_arguments,设置不同的index。

paddle_arguments_set_value(in_args, 0, sparse_mat)
paddle_arguments_set_value(in_args, 1, dense_mat)

@qingqing01 qingqing01 added Predict User 用于标记用户问题 labels Aug 17, 2017
@reyoung
Copy link
Collaborator

reyoung commented Aug 23, 2017

Duplicated with #3182

@reyoung reyoung closed this as completed Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate User 用于标记用户问题
Projects
None yet
Development

No branches or pull requests

3 participants