Closed
[Documentation|文档反馈]: 修复格式转换、FillDiagonal、卷积权重与Triu示例中的接口说明和代码错误 #3108
wangchao661Add on  Sep 9Closed at  Sep 14
wangchao661
wangchao661Collaborators
Sep 9 Create

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

一、文档链接 (必填)

  1. aclnnNpuFormatCast
  2. aclnnInplaceFillDiagonal
  3. aclnnCalculateConvolutionWeightSize
  4. aclnnTransConvolutionWeight
  5. aclnnTriu & aclnnInplaceTriu

二、问题文档片段 (必填)

  1. aclnnNpuFormatCast

    • 示例实际调用 aclnnNpuFormatCast(...),注释却写为:
      // 调用aclnnNpuFormatCastGetWorkspaceSize第二段接口
      
    • 约束表中存在错误枚举:
      ACL_FRACTAL_Z_3D(33)
      ACL_FORMAT_NHWC(2)
      
      应分别为 ACL_FORMAT_FRACTAL_Z_3D(33) 与 ACL_FORMAT_NHWC(1)。
  2. aclnnInplaceFillDiagonal

    • wrap=True 的公式包含:
      0 <= i < col // r
      
      同一公式定义 0 <= r < m,因此当 r=0 时发生除零。
    • fillValue 的使用说明称“可转换为 FLOAT”,但数据类型列只写 INT64,与接口支持范围及 FLOAT 示例不一致。
  3. aclnnCalculateConvolutionWeightSize

    • 动态计算实际分配大小后仍保留固定值注释:
      uint64_t size = transWeightSize * sizeof(float) / 2;
      // size = 8192 * sizeof(float_t);
      
    • 设备资源释放遗漏:
      aclrtFree(inputDeviceAddr);
      aclrtFree(weightDeviceAddr);
      aclrtFree(transWeightDeviceAddr);
      aclrtFree(outDeviceAddr);
      
      biasDeviceAddr 已申请但未释放。
  4. aclnnTransConvolutionWeight

    • 示例后半段调用:
      aclnnConvolutionGetWorkspaceSize(...)
      aclnnConvolution(...)
      
      但本文档未说明这两个接口是示例的后续依赖,也未提示读者查阅对应接口文档。
  5. aclnnTriu & aclnnInplaceTriu

    • 错误码表格中实际错误原因数量与 rowspan="7" 不一致:Triu 实际为 6 行,InplaceTriu 实际为 3 行。
    • InplaceTriu 示例存在语法错误:
      CHECK_RET(... return ret;);
      
      末尾多出一个右括号。

💡 存在的问题(选填)

likedislike
wangchao661wangchao661Collaborators
Sep 9 Added label: documentation
wangchao661wangchao661Collaborators
Sep 9 Assign wangchao661 as responsible person
wangchao661wangchao661Collaborators
Sep 10 Associated pull request
Xu-XuePengXu-XuePengCollaborators
Sep 10 Associated pull request
Xu-XuePengXu-XuePengCollaborators
Sep 10 Deleted associated pull request: aclnnClampMax等资料问题
Xu-XuePengXu-XuePengCollaborators
Sep 10 Associated pull request
Xu-XuePengXu-XuePengCollaborators
Sep 10 Associated pull request
Xu-XuePengXu-XuePengCollaborators
Sep 10 Deleted associated pull request: aclnnClampMax等资料问题
Xu-XuePengXu-XuePengCollaborators
Sep 10 Associated pull request
wangchao661wangchao661Collaborators
Sep 14 changed custom state from 进行中 to 已完成
wangchao661wangchao661Collaborators
Sep 14 Close issue
CANN-robotCANN-robotCollaborators
Sep 14 Added label: resolved