已关闭
[Documentation|文档反馈]: top_k_top_p_sample #5591
licheng261创建于  9月5日关闭于  9月7日
licheng261
9月5日 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Document Link(文档链接)

ops-nn/index/top_k_top_p_sample/docs/aclnnTopKTopPSample.md

ops-nn/index/top_k_top_p_sample/examples/test_aclnn_top_k_top_p_sample.cpp

Issues Section(问题文档片段)

函数原型与调用示例参数名不一致:函数原型aclnnTopKTopPSampleGetWorkspaceSize声明的参数名为logitsSelectIdx,但调用示例代码中声明的对应变量名为logitsSelectedIdx(多了'ed'后缀),参数命名风格不一致。

参数表logitsTopKPSelect维度标为1,与约束说明及示例的2维矛盾,易致用户创建错误Tensor引发报错。

2.5 示例代码可执行性问题:logitsSelectIdx 输出张量声明为 INT64(每元素 8 字节),但取回结果的缓冲区是 std::vector(每元素 4 字节),aclrtMemcpy 拷贝字节数按 sizeof(float) 计算,只拷贝 192 字节而非 384 字节;同时 printf 使用 %d 打印 float 值,类型不匹配,导致输出结果错误。

Existing Issues(存在的问题)

likedislike
Llicheng261
9月5日 关联了pull request:Fix top_k_top_p_sample docs and example
yuning_chenyuning_chen成员
9月5日 将 licheng261 设为负责人
CANN-robotCANN-robot成员
9月7日 关闭了 issue
CANN-robotCANN-robot成员
9月7日 添加了label:resolved