Merged
fix(operation): Tan Add Constraint #5880
刘奕哲Add on Sep 2
fix(operation): Tan Add Constraint #5880
Merged
刘奕哲Add on Sep 2
刘奕哲
Sep 2

描述

补充Tan算子拦截5维以及更高维用例

测试

完成冒烟测试

关联Issue

#3202

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 刘奕哲's contribution.)
刘奕哲刘奕哲
Sep 2 Created pull request, commit 3a4440db
刘奕哲刘奕哲
Sep 2 Associated issue: [Bug-Report|缺陷反馈]: Tan算子未拦截5维以及更高维用例
atomgit-bot
atomgit-bot
Sep 2 Comments:

变更摘要

该 PR 是针对 Tan 算子的 Bug 修复,目标是拦截 5 维及以上维度的输入用例(关联 issue #3202)。核心改动是在 framework/src/interface/operation/vector/trigonometric.cpp 的 Tan 函数中新增维度范围校验:在原有 CheckTensorFormat 格式检查之后、数据类型检查之前,追加一次 CheckTensorDimRange 调用,将输入张量维度限制在 1 到 4(NUM_VALUE_4)之间,从而在参数校验阶段提前拒绝高维用例。该改动涉及 1 个文件、新增 1 行代码,并已完成冒烟测试。

主要改动

  • 新增维度范围校验: 在 Tan 函数中调用 CheckTensorDimRange(operand.GetStorage(), 1, NUM_VALUE_4, "Tan"),将允许的输入维度限制为 1–4 维,实现对 5 维及更高维用例的拦截。
  • 校验位置调整: 该校验被插入在 CheckTensorFormat 格式检查与后续 dtype 支持性检查之间,使高维非法输入能在后续处理前被尽早拒绝。

注:NUM_VALUE_4 为表示最大维度 4 的常量,函数名 Tan 及文件路径均保留原文。

likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 2 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 2 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 2 Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
framework/src/interface/operation ✅ 尹杰, shi-dingkun (2/2) ✅ 尹杰 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robot
CANN-robotCollaborators
Sep 2 Comments:

CLA Signature Pass

Creeeeper, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robotCollaborators
Sep 2 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
CANN-robotCANN-robotCollaborators
Sep 2 Set xinweiliu,cam_bxh,dai-zhentao,shi-dingkun,gguuaanngg,yinjie27_,tsungl4,make_pto,linjiashu as approver
刘奕哲
刘奕哲
Sep 2 Comments:

compile

likedislike
刘奕哲刘奕哲
Sep 2 Pre merge succeeded (commit_id: 602ca52771eac286083d399f576f4a44579a8634)
CANN-robot
CANN-robotCollaborators
Sep 2 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 2 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 2 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 2 Added label: ci-pipeline-passed
刘奕哲刘奕哲
Sep 3 Modify description of pull request
shi-dingkun
shi-dingkunCollaborators
Sep 3 Comments:

/lgtm

likedislike
Jie Yin
Jie YinCollaborators
Sep 3 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 3 Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
Sep 3 Closed associated issue
CANN-robotCANN-robotCollaborators
Sep 3 Merged pull request