| Files | Last commit | Last update |
|---|---|---|
math仓aidd修改 Co-authored-by: caiwenwen<caiwenwen6@h-partners.com> # message auto-generated for no-merge-commit merge: !7334 merge master into master math仓aidd修改 Created-by: caiwenwen Commit-by: caiwenwen Merged-by: cann-robot Description: ## 描述 cv仓修改aidd ## 关联的Issue 关联Issue https://gitcode.com/cann/ops-transformer/issues/7362 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] 🐛 Bug修复 - [ ] ✨ 新特性 - [ ] ⚡ 性能优化 - [ ] ♻️ 重构 - [ ] 🧪 测试 - [ ] 📦 构建/CI - [ ] 🔧 配置变更 - [x] 📝 文档更新 - [ ] ⬆️ 依赖升级 - [ ] 🔒 安全修复 - [ ] 🧹 代码清理 - [ ] ❓ 其他,请描述: See merge request: cann/ops-math!7334 | 2 days ago | |
Round示例改用C++ RAII资源管理,与IsFinite/IsInf示例风格对齐 Co-authored-by: zhouqilong<zhouqilong2@huawei.com> # message auto-generated for no-merge-commit merge: !4744 merge raii-round into master Round示例改用C++ RAII资源管理,与IsFinite/IsInf示例风格对齐 Created-by: zhou-qilong Commit-by: zhouqilong Merged-by: cann-robot Description: ## 描述 将 math/round/examples 下的 aclnn 示例由手动资源管理改为 C++ RAII 管理,与同仓 math/is_finite、math/is_inf 示例风格保持一致。 ## 测试 验证文件: - math/round/examples/test_aclnn_round.cpp - math/round/examples/test_aclnn_round_decimals.cpp C++11 编译、链接通过。 test_aclnn_round.cpp:输入为 [1.1,2.8,3.5],期望输出为 [1,3,4],实际输出与期望一致。 test_aclnn_round_decimals.cpp:输入为 [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8],decimals 为 0,期望输出为 [0,0,0,0,0,1,1,1],实际输出与期望一致。 ## 文档更新 无。 ## 类型标签 - [x] 其他,请描述:示例代码改造(C++ RAII资源管理) See merge request: cann/ops-math!4744 | 13 days ago | |
迁移开源TF插件--math Co-authored-by: yaochen<yaochen15@huawei.com> # message auto-generated for no-merge-commit merge: !4308 merge transfer-math into master 迁移开源TF插件--math Created-by: nextyale Commit-by: yaochen Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:迁移TF插件 See merge request: cann/ops-math!4308 | 3 months ago | |
docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Co-authored-by: tianye<tianye82@h-partners.com> # message auto-generated for no-merge-commit merge: !7166 merge br_fixissue into master docs(math): 对齐 Round/Log/Exp/LogicalNot 接口文档与头文件注释 Created-by: transformer910 Commit-by: tianye Merged-by: cann-robot Description: ## 描述 本 PR 修复 ops-math 中 Round、Log、Exp、LogicalNot 相关 aclnn 接口的头文件注释、接口文档和示例与实现不一致的问题,全部为文档/注释口径校正及示例日志修正,不改变运行时行为。 主要改动: | Issue | 问题 | 修复 | | --- | --- | --- | | #4163 | aclnnInplaceLog2 的 selfRef 注释漏列 DOUBLE/COMPLEX64/COMPLEX128 | 按资料与实现补齐 3 种 dtype | | #4142 | aclnnInplaceRoundDecimals 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRoundDecimals 的 self 注释对齐 | | #4132 | aclnnLog10 的 161002 错误码表缺「self 与 out 的 shape 不一致」 | 补充子项,rowspan 3→4 | | #4131 | aclnnLog10 的 out 数据类型列漏列 DOUBLE | 补齐 DOUBLE,与同行使用说明及实现一致 | | #4105 | test_aclnn_inplace_log10.cpp 示例输出标签误写为 acos | 改为 log10 | | #3917 | aclnnExp 的 self 注释漏列 INT64 | 按资料与实现支持列表补齐 | | #3916 | aclnnInplaceRound 错误码表缺 161002 整类说明 | 补充 dtype/format 与维数大于 8 两项 | | #3915 | aclnnInplaceRound 的 selfRef 注释漏列 BFLOAT16 | 与同文件 aclnnRound 的 self 注释对齐 | | #3722 | logical_not/README.md 仍称“仅包含 aclnn 接口”,但已存在 op_kernel 实现 | 按实际交付件补充功能说明、实现位置、样例与文档入口 | | #4164 | aclnnRoundDecimals 参数表 decimals 使用说明为空 | 补充整数语义与大值溢出行为说明;未写死统一取值范围,避免与不同产品/计算路径的实际边界冲突 | ## 关联的Issue - https://gitcode.com/cann/ops-math/issues/4163 - https://gitcode.com/cann/ops-math/issues/4142 - https://gitcode.com/cann/ops-math/issues/4132 - https://gitcode.com/cann/ops-math/issues/4131 - https://gitcode.com/cann/ops-math/issues/4105 - https://gitcode.com/cann/ops-math/issues/3917 - https://gitcode.com/cann/ops-math/issues/3916 - https://gitcode.com/cann/ops-math/issues/3915 - https://gitcode.com/cann/ops-math/issues/3722 - https://gitcode.com/cann/ops-math/issues/4164 ## 测试 - 对照仓内实现中的 dtype 支持列表、错误码校验路径和资料参数表逐条核对,确认修改后的注释/文档与实现一致。 - 改动均为注释、Markdown 文档和示例字符串,未改接口签名、校验逻辑或 kernel 实现。 - git diff --check 通过,无空白符错误。 - 未执行 NPU 上板验证:本次仅涉及文档、注释和示例日志标签。 ## 文档更新 - math/exp/op_api/aclnn_exp.h - math/log/op_api/aclnn_log2.h - math/log/docs/aclnnLog10&aclnnInplaceLog10.md - math/log/examples/test_aclnn_inplace_log10.cpp - math/round/op_api/aclnn_round.h - math/round/docs/aclnnRound&aclnnInplaceRound.md - math/round/docs/aclnnRoundDecimals&aclnnInplaceRoundDecimals.md - math/logical_not/README.md ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7166 | 7 days ago | |
round,rsqrt,rsqrt_grad,sort算子支持下一代实现 Co-authored-by: Huang-Peng<huangpeng98@huawei.com> # message auto-generated for no-merge-commit merge: !557 merge trans-part1228 into master round,rsqrt,rsqrt_grad,sort算子支持下一代实现 Created-by: Huang-Peng Commit-by: Huang-Peng Merged-by: cann-robot Description: ## 描述 round,rsqrt,rsqrt_grad,sort算子支持最新实现 ## 关联的Issue 不涉及 ## 测试 已完成本地编译、UT、二级冒烟等测试 ## 文档更新 更新了round,rsqrt,rsqrt_grad,sort等算子的README实现 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!557 | 10 months ago | |
feat: vector算子批量适配ascend960pr(DV122)平台 Co-authored-by: biabu111<hebaojing1@huawei.com> # message auto-generated for no-merge-commit merge: !6663 merge feat/dv122-ascend960pr-adaptation into master feat: vector算子批量适配ascend960pr(DV122)平台 Created-by: biabu111 Commit-by: biabu111 Merged-by: cann-robot Description: ## 描述 DV122(Ascend960PR / dav_9202 / Ascend960PR_969A1)vector 算子批量适配。参照 ascend960dt(DAV_9201) 既有适配模式,为 vector 算子清单内 66 个算子补齐 ascend960pr 支持,适配原则:9201 支持的能力 9202 均支持。 **注册级适配(66 算子):** - CMakeLists.txt:SUPPORT_COMPUTE_UNIT 追加 "ascend960pr",SUPPORT_TILING_DIR 按位插入对应 arch35 - op_host/*_def.cpp:AICore().AddConfig("ascend960pr", <960dt 同款配置>) - op_host/config/ascend960pr/:二进制配置(*_binary.json / *_simplified_key.ini,复制自 ascend960dt,与 960dt 内容一致) - op_kernel*/CMakeLists.txt:COMPUTE_UNITS 追加 ascend960pr(arch92 kernel 入口同步生效) - scripts/kernel/binary_config/ascendc_config.json:compute_units 与 compile_options 补齐 **代码级补齐(9201 → 9201||9202):** - tiling/aclnn/infershape/fusion_pass/kernel 中 NpuArch::DAV_9201、__NPU_ARCH__ == 9201、"Ascend960DT" 等 960 平台门禁补齐 DAV_9202 / 9202 / "Ascend960PR" - 覆盖 concat/tanh_grad/slice/strided_slice/expand/tensor_equal/lin_space/range 等的 tiling/aclnn/graph_infer/fusion_pass 平台门禁(家族特性判定依据:gather_v2 适配提交中 isAscend96_ = DAV_9201||DAV_9202、unsorted_segment_sum 注释"ascend960dt/ascend960pr(DAV_9201/DAV_9202) 平台判定,用于 960 专属特性(ScatterDataCopy 等)的运行时开关") ## 关联的Issue https://gitcode.com/cann/ops-math/issues/4682 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 冒烟、ut、st已通过 <!--描述进行了哪些测试来验证你的改动。--> - CANN 9.3.0 工具链 --soc=ascend960pr 构建 19 个抽样算子(覆盖全部修改类型):宿主侧(def/tiling/infershape/aclnn)100% 编译通过,0 错误 - 构建日志确认正确消费新增的 config/ascend960pr/*_binary.json - --soc=ascend960dt 同算子集构建行为一致,无回归 - 一致性审计:范围内 960dt-without-960pr 注册缺口 0;修改过的 CMakeLists SUPPORT_COMPUTE_UNIT/TILING_DIR 位置对齐 0 问题;ascendc_config.json 语法有效 - 注:opc 二进制生成阶段因当前工具链缺 Ascend960PR_969A1 平台数据无法本地执行,需在 CI(含 960PR 平台数据的工具链)完成二进制编译与上板验证 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-math!6663 | 2 days ago | |
refactor: arch35 算子 Regbase Reg 层旧接口替换为新接口 Co-authored-by: ywx1080114<yuanbin22@huawei.com> # message auto-generated for no-merge-commit merge: !4527 merge fix/api-rename-regbase into master refactor: arch35 算子 Regbase Reg 层旧接口替换为新接口 Created-by: yuanbin_22 Commit-by: ywx1080114 Merged-by: cann-robot Description: ## 描述 将 ops-math 仓库中 19 个算子的 arch35 regbase kernel 实现从 Reg 层旧接口替换为新接口,同时将地址空间限定符 __local_mem__ 统一替换为 __ubuf__,使代码与 AscendC SDK 最新命名规范保持一致。 ### 改动原因 AscendC SDK 新版本对 Reg 层 API 进行了重命名,旧 API(如 Reg::DataCopy、Reg::CompareScalar、Reg::MaskAnd、Reg::MaskOr、Reg::MaskPack、Reg::FusedAbsSub、Reg::FusedMulDstAdd 等)将逐步废弃。本 PR 同步更新仓库中 arch35 regbase 算子 kernel 的接口调用,避免使用将废弃的 API。 ### 改动方法 对 22 个 arch35 regbase kernel 头文件进行批量接口替换,涉及 19 个 math 算子: add_n(2 个文件:add_n_regbase.h、add_n_regbase_fullload.h)、assign_add、assign_sub、cast(cast_impl.h)、ceil、exp、floor(3 个文件:floor_bf16.h、floor_f16.h、floor_f32.h)、is_close(is_close_dag.h)、log、log1p、nan_to_num、neg、reciprocal、round、rsqrt、rsqrt_grad、sign(sign.h)、tanh、trunc 接口替换映射如下: | 旧接口 | 新接口 | 说明 | |--------|--------|------| | Reg::DataCopy(reg, addr) | Reg::LoadAlign(reg, addr) | UB→Reg 加载 | | Reg::DataCopy(addr, reg) | Reg::StoreAlign(addr, reg) | Reg→UB 存储 | | Reg::DataCopy<T, LoadDist/StoreDist> | Reg::LoadAlign/StoreAlign<T, Dist> | 带 Dist 模板参数 | | Reg::DataCopy<T, PostLiteral, Dist> | Reg::LoadAlign/StoreAlign<T, PostLiteral, Dist> | 带 PostLiteral | | Reg::CompareScalar | Reg::Compares | 标量比较 | | CompareScalar(无命名空间) | Compares | 标量比较 | | Reg::MaskAnd | Reg::And | 掩码与运算 | | Reg::MaskOr | Reg::Or | 掩码或运算 | | Reg::MaskPack | Reg::Pack | 掩码打包 | | Reg::FusedAbsSub | Reg::AbsSub | 融合绝对差 | | Reg::FusedMulDstAdd | Reg::MulDstAdd | 融合乘加 | | __local_mem__ | __ubuf__ | 地址空间限定符(涉及 floor、is_close 算子) | > 注:上述替换同时覆盖带 AscendC:: 前缀和不带前缀两种调用形式。替换为纯命名变更,不涉及计算逻辑修改,部分接口替换伴随行格式重排(缩进调整)。 ## 关联的Issue https://gitcode.com/cann/ops-math/issues/2585 ## 测试 接口替换为纯命名变更,不涉及计算逻辑修改,通过编译验证和已有 ST/UT 用例回归验证。 ## 文档更新 无 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [x] 其他,请描述:接口重命名,代码规范对齐 ## AI/Agent生成声明 - [x] AI辅助编写 See merge request: cann/ops-math!4527 | 2 months ago | |
常量折叠和infershape整改 Co-authored-by: liu-lu<www.liulu824910939@qq.com> # message auto-generated for no-merge-commit merge: !4582 merge master into master 常量折叠和infershape整改 Created-by: liu-lu Commit-by: liu-lu Merged-by: cann-robot Description: ## 描述 本 PR 为 6 个 AICPU 算子(add、round、search_sorted、select_v2、square、squared_difference)使能 GE 图编译期常量折叠,并对 search_sorted、select_v2 进行 infershape/OpDef 整改。 ### 变更内容 **1. 常量折叠使能(6 算子)** | 算子 | CMakeLists | kernel 注册 | |------|-----------|-------------| | add | 增加 HOSTCPU TRUE | REGISTER_CPU_KERNEL → OPS_MATH_REGISTER_CPU_KERNELV2 | | round | 增加 HOSTCPU TRUE | REGISTER_CPU_KERNEL → OPS_MATH_REGISTER_CPU_KERNELV2 | | search_sorted | 增加 HOSTCPU TRUE | REGISTER_CPU_KERNEL → OPS_MATH_REGISTER_CPU_KERNELV2 | | select_v2 | 增加 HOSTCPU TRUE | REGISTER_CPU_KERNEL → OPS_MATH_REGISTER_CPU_KERNELV2 | | square | 增加 HOSTCPU TRUE | REGISTER_CPU_KERNEL → OPS_MATH_REGISTER_CPU_KERNELV2 | | squared_difference | 增加 HOSTCPU TRUE | REGISTER_CPU_KERNEL → OPS_MATH_REGISTER_CPU_KERNELV2 | - 各 kernel 增加 #include "aicpu/math_aicpu_register.h"; - CMakeLists 增加 HOSTCPU TRUE,将算子编入 host 侧折叠 so(libopconstant_folding_math.so)。 **2. infershape / OpDef 整改** - **search_sorted**:新增 op_host/search_sorted_infershape.cpp,实现 InferShape4SearchSorted,输出 shape 取 values(input1)的 shape; - **select_v2**:新增 op_kernel_aicpu/select_v2_aicpu_def.cpp(基于 OpDef 注册输入输出数据类型),删除旧 select_v2.json(JSON 配置方式),统一为 OpDef 注册链路。 ## 关联的Issue #2847 ## 测试 根据代码变更,测试场景如下: 1. **编译构建测试** - 执行 cmake 配置与编译,验证 6 个算子 CMakeLists HOSTCPU TRUE 配置变更正确; - 确认 libopconstant_folding_math.so 中已编入上述 6 个算子的 host 侧 kernel。 2. **常量折叠验证** - 输入为常量时,验证算子可在图编译期被折叠求值(host 侧执行),运行期不再下发 device kernel; - 输入为非常量时,验证 device 侧执行逻辑与折叠前保持一致。 3. **InferShape 验证(search_sorted)** - 验证 search_sorted 输出 shape 与 values 输入 shape 一致; - 覆盖多维度、边界 shape 场景。 4. **算子注册/加载验证(select_v2)** - 验证 select_v2 基于 OpDef 注册后接口可正确加载与调用; - 覆盖全数据类型(COMPLEX128/COMPLEX64/DOUBLE/FLOAT/FLOAT16/INT16/INT32/INT64/INT8/UINT16/UINT32/UINT64/UINT8/BOOL)。 5. **算子泛化** - 对 6 个算子执行二级冒烟与泛化用例,确认功能正确性不受影响。 ## 文档更新 本 PR 不涉及 README/aclnn 接口文档更新。 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!4582 | 2 months ago | |
批量算子golden支持全通路 Co-authored-by: ligen<ligen75@h-partners.com> # message auto-generated for no-merge-commit merge: !5750 merge master into master 批量算子golden支持全通路 Created-by: ligen75 Commit-by: ligen Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 批量算子golfen新增支持aclnn,e2e通路 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> https://gitcode.com/cann/ops-math/issues/3210 ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> 自验通过 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!5750 | 1 month ago | |
feat: vector算子批量适配ascend960pr(DV122)平台 Co-authored-by: biabu111<hebaojing1@huawei.com> # message auto-generated for no-merge-commit merge: !6663 merge feat/dv122-ascend960pr-adaptation into master feat: vector算子批量适配ascend960pr(DV122)平台 Created-by: biabu111 Commit-by: biabu111 Merged-by: cann-robot Description: ## 描述 DV122(Ascend960PR / dav_9202 / Ascend960PR_969A1)vector 算子批量适配。参照 ascend960dt(DAV_9201) 既有适配模式,为 vector 算子清单内 66 个算子补齐 ascend960pr 支持,适配原则:9201 支持的能力 9202 均支持。 **注册级适配(66 算子):** - CMakeLists.txt:SUPPORT_COMPUTE_UNIT 追加 "ascend960pr",SUPPORT_TILING_DIR 按位插入对应 arch35 - op_host/*_def.cpp:AICore().AddConfig("ascend960pr", <960dt 同款配置>) - op_host/config/ascend960pr/:二进制配置(*_binary.json / *_simplified_key.ini,复制自 ascend960dt,与 960dt 内容一致) - op_kernel*/CMakeLists.txt:COMPUTE_UNITS 追加 ascend960pr(arch92 kernel 入口同步生效) - scripts/kernel/binary_config/ascendc_config.json:compute_units 与 compile_options 补齐 **代码级补齐(9201 → 9201||9202):** - tiling/aclnn/infershape/fusion_pass/kernel 中 NpuArch::DAV_9201、__NPU_ARCH__ == 9201、"Ascend960DT" 等 960 平台门禁补齐 DAV_9202 / 9202 / "Ascend960PR" - 覆盖 concat/tanh_grad/slice/strided_slice/expand/tensor_equal/lin_space/range 等的 tiling/aclnn/graph_infer/fusion_pass 平台门禁(家族特性判定依据:gather_v2 适配提交中 isAscend96_ = DAV_9201||DAV_9202、unsorted_segment_sum 注释"ascend960dt/ascend960pr(DAV_9201/DAV_9202) 平台判定,用于 960 专属特性(ScatterDataCopy 等)的运行时开关") ## 关联的Issue https://gitcode.com/cann/ops-math/issues/4682 <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #000--> ## 测试 冒烟、ut、st已通过 <!--描述进行了哪些测试来验证你的改动。--> - CANN 9.3.0 工具链 --soc=ascend960pr 构建 19 个抽样算子(覆盖全部修改类型):宿主侧(def/tiling/infershape/aclnn)100% 编译通过,0 错误 - 构建日志确认正确消费新增的 config/ascend960pr/*_binary.json - --soc=ascend960dt 同算子集构建行为一致,无回归 - 一致性审计:范围内 960dt-without-960pr 注册缺口 0;修改过的 CMakeLists SUPPORT_COMPUTE_UNIT/TILING_DIR 位置对齐 0 问题;ascendc_config.json 语法有效 - 注:opc 二进制生成阶段因当前工具链缺 Ascend960PR_969A1 平台数据无法本地执行,需在 CI(含 960PR 平台数据的工具链)完成二进制编译与上板验证 ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> 不涉及 ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: ## AI/Agent生成声明 <!-- [x] 表示选中 --> - [x] AI辅助编写 See merge request: cann/ops-math!6663 | 2 days ago | |
产品名变更 Co-authored-by: gitcode-chenjiao<chenjiao31@huawei.com> # message auto-generated for no-merge-commit merge: !5912 merge master into master 产品名变更 Created-by: gitcode-chenjiao Commit-by: gitcode-chenjiao Merged-by: cann-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> AI处理器对应的产品型号名称更新 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> [#3258](https://gitcode.com/cann/ops-math/issues/3258) ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ok ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> *.md ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!5912 | 1 month ago | |
docs: add English translations for markdown files Co-authored-by: jenny_xiang<jenny.xiang@huawei.com> # message auto-generated for no-merge-commit merge: !7113 merge docs/add-english-translations into master docs: add English translations for markdown files Created-by: jenny_xiang Commit-by: jenny_xiang Merged-by: cann-robot Description: ## 描述 新增仓库Markdown文档英文译稿(第二批,共409个文件):第一批(已合入)之外的其余全部译稿,覆盖conversion、examples、ge、math、random各类算子README译稿,以及CHANGELOG_en.md、.gitcode PR模板英文版等。 本批内全部仓内链接均指向master已有文件(含第一批已合入的21+2篇译稿),合入后本仓432篇英文文档全部就位,链接完整生效。 本批同时包含4篇基于最新源文档的增量更新(math/ada_cast、math/prod_force_se_a、math/sinkhorn、math/xlogy,对应上游近期文档变更)。 ## 关联的Issue 无 ## 测试 文档类变更,无需算子测试;已通过链接有效性校验(本批全部相对链接仅指向master已有文件,无指向本PR外未提交文件的链接),并完成逐篇翻译规范自查与语义校对(含支持状态表、限定词、术语、数值符号核对)。 ## 文档更新 新增409个英文译稿文件(*_en.md / .en-US.md),不修改任何现有文件。 ## 类型标签 - [ ] Bug修复 - [ ] 新特性 - [ ] 性能优化 - [x] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!7113 | 9 days ago |
Round
English | 简体中文
Product Support Status
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | × |
| Atlas inference products | × |
| Atlas training products | √ |
Function Description
- Rounds the values of the input tensor to the nearest integer. If the value is equidistant from two integers, rounds to the even integer.
- Rounds the elements of the input tensor to the specified number of decimal places.
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | Input tensor. | BFLOAT16, FLOAT16, FLOAT32, DOUBLE, INT32, INT64 | ND |
| decimals | Attribute | An optional integer attribute that specifies the number of decimal places to retain. The default value is 0. | INT | - |
| y | Output | Output tensor. | Same as the input tensor x | ND |
Constraint Description
- When the input value is in [-0.5, -0], the output value is 0.
- For scenarios where decimals is not 0: if the input data exceeds the range (-347000, 347000), the precision may be affected.
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_round | Invokes the Round operator through the aclnnRound API |
| Graph-mode invocation | test_geir_round | Invokes the Round operator by building a graph through the operator IR. |