Closed
[Bug-Report|缺陷反馈]: 补充 InferDataType RT2.0 推导并新增 UT 看护 #4640
fitZepHYrAdd on 6 days agoClosed at 3 days ago
6 days ago Added label: bug-report
6 days ago Assign VoyageZhou as responsible person
6 days ago Modify description of issue
3 days ago Close issue
3 days ago changed custom state from 待办的 to 已完成
3 days ago Added label: resolved
一、问题描述 (必填)
CdistGrad的 Host 侧仅注册了InferShape,未注册 RT2.0 的InferDataType,导致算子在 RT2.0 流程中无法自行推导输出y的数据类型。参考math/abs/op_host/abs_infershape.cpp中InferDataType的 RT2.0 内联注册写法,为CdistGrad补充输出 dtype 推导,并新增 UT 看护。二、环境信息 (可选)
--soc=ascend910b)三、重现步骤 (可选)
math/cdist_grad/op_host/cdist_grad_infershape.cpp,注册链只有IMPL_OP_INFERSHAPE(CdistGrad).InferShape(InferShape4CdistGrad);,没有InferDataType。CdistGrad,算子未注册infer_datatype,输出y的 dtype 无法由算子注册信息推导。bash build.sh -u --ophost --soc=ascend910b --ops=cdist_grad --gtest_filter='CdistGradInfershape.*',新增的 InferDataType 用例可在修复前复现该缺失。四、预期结果 (可选)
CdistGrad注册InferDataType,输出y的 dtype 与输入grad保持一致(grad/x1/x2/cdist要求同 dtype)。grad。💡 备注(选填)
关联 PR:https://gitcode.com/cann/ops-math/pull/7246