| fix: 修复topk/calc_buckets_limit_and_offset/compare_and_bit_pack算子UT问题 Co-authored-by: sujunwei3<sujunwei3@huawei.com> # message auto-generated for no-merge-commit merge: !4173 merge fix/ut-issues into master fix: 修复topk/calc_buckets_limit_and_offset/compare_and_bit_pack算子UT问题 Created-by: sujunwei3 Commit-by: sujunwei3 Merged-by: cann-robot Description: ## 描述 修复 topk、calc_buckets_limit_and_offset、compare_and_bit_pack 三个算子的 UT 问题及内核参数校验缺失。 **calc_buckets_limit_and_offset 算子:** - 内核代码新增 total_limit >= 0 参数校验和 bucket_list[i] >= 0 输入范围检查 - 修复 UT 中 input2_num 赋值 typo(input1->NumElements() → input2->NumElements()) **compare_and_bit_pack 算子:** - COMPLEX64 用例重命名为 INPUT_COMPLEX64_UNSUPPORTED,移除无效输出验证 - BOOL 用例修正 input1 值(true → false)及期望结果 - DIM_ERROR 用例修正 shape 和输入数据指针 **topk 算子:** - 重写 SMALLEST_LAST_DIM 测试:修正输出维度、使用随机值填充、按行排序取 top-2、添加完整结果校验 ## 关联的Issue #2285 ## 测试 1. **单元测试验证** - 执行 calc_buckets_limit_and_offset 算子 UT,验证参数校验和范围检查生效 - 执行 compare_and_bit_pack 算子 UT,验证 COMPLEX64/BOOL/DIM_ERROR 用例通过 - 执行 topk 算子 UT,验证 SMALLEST_LAST_DIM 用例排序结果正确 2. **回归测试** - 确保修改不影响其他已有 UT 用例的通过 ## 文档更新 无文档更新 ## 类型标签 - [x] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!4173 | 17 天前 |