We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
尝试写一下paddle 的capi...确实挺麻烦. 每个api ,都得查源码才稍微了解,
The text was updated successfully, but these errors were encountered:
@ranqiu92 @peterzhang2029 请帮忙回答一下关于 CAPI 相关的问题吧,谢谢了。
Sorry, something went wrong.
C-API提供了paddle_arguments_set_sequence_start_pos接口来标记每个样本里序列的起始位置,有四个参数:
paddle_arguments_set_sequence_start_pos
示例代码如下:
int seq_pos_array[] = {0, 1, 3, 6}; paddle_ivector seq_pos = paddle_ivector_create( seq_pos_array, sizeof(seq_pos_array) / sizeof(int), false, false); CHECK(paddle_arguments_set_sequence_start_pos(in_args, 0, 0, seq_pos));
输入数据为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
数据的每行表示一个长度为5的特征向量,数据格式为dense vector。
其中,seq_pos_arry 的前3个元素表示对应位置的样本中序列开始的位置,而最后一个元素表示输入数据中所有的dense vector的数量。通过调用paddle_arguments_set_sequence_start_pos接口,示例代码将输入数据转化为3个dense vector sequece类型的样本数据:
seq_pos_arry
[[[1 2 3 4 5]], [[6 7 8 9 10], [11 12 13 14 15]], [[16 17 18 19 20], [21 22 23 24 25], [26 27 28 29 30]]]
类似的issue #3969
No branches or pull requests
尝试写一下paddle 的capi...确实挺麻烦. 每个api ,都得查源码才稍微了解,
The text was updated successfully, but these errors were encountered: