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

c-api支持多slot混合类型输入 #3182

Closed
Jarlonyan opened this issue Aug 2, 2017 · 6 comments
Closed

c-api支持多slot混合类型输入 #3182

Jarlonyan opened this issue Aug 2, 2017 · 6 comments
Labels
User 用于标记用户问题

Comments

@Jarlonyan
Copy link

Jarlonyan commented Aug 2, 2017

2017-08-02 9 08 36

请问,C-API支持多slot混合类型输入吗??我在上面的demo中没有找到。我记得在v1版本中有MultiType支持多类型的输入的,为什么现在没有了??

@QiJune
Copy link
Member

QiJune commented Aug 2, 2017

支持的,这里面只是给出每个slot的使用方法;可以进行组合使用

@QiJune QiJune added Bug User 用于标记用户问题 and removed Bug labels Aug 2, 2017
@superxiaoyu
Copy link

关注+1,求组合使用的栗子。

比如我的输入包括integer_value_sequence和dense_vector_sequence两个datalayer,前者上面有例子,后者比如[ [1.0,2.0,3.0], [4.0,5.0,6.0] ],我是应该用一个23的dense mat呢,还是用一个16的mat,以及paddle_arguments_set_sequence_start_pos这里是否需要、传进去什么,不大清楚api里的mat的行维度是针对样本批量的,还是关于单个序列样本的。

@QiJune
Copy link
Member

QiJune commented Aug 2, 2017

好的,后续会增加不同类型slot混合使用的例子

@QiJune
Copy link
Member

QiJune commented Aug 9, 2017

@Jarlonyan @superxiaoyu
这里是一段设置多个input的伪代码

  // create in args	
  paddle_arguments in_args = paddle_arguments_create_none();
  // the size 4 means you have 4 kinds of input
  paddle_arguments_resize(in_args, 4);

  // set value for each in_args
  paddle_arguments_set_ids(in_args, 0, ...);

  paddle_arguments_set_value(in_args, 1, ...);

  paddle_arguments_set_value(in_agrs, 2, ...);
  
  paddle_arguments_set_value(in_args, 3, ...);

@QiJune
Copy link
Member

QiJune commented Aug 9, 2017

@superxiaoyu
应该是一个16的mat,paddle里面一条样本数据使用一行表示,矩阵的行数表示batch_size。
paddle_arguments_set_sequence_start_pos是需要设置的,可以参考注释中的用法。比如[ [1.0,2.0,3.0], [4.0,5.0,6.0] ],那么就应该设置seq_pos_array为 [0, 2]

@Jarlonyan
Copy link
Author

可以啦。周一晚上我看源代码找到了方法。。。。已经验证可行了。谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User 用于标记用户问题
Projects
None yet
Development

No branches or pull requests

4 participants