| Files | Last commit | Last update |
|---|---|---|
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago | |
feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Co-authored-by: doufloat<baijinxiang@huawei.com> # message auto-generated for no-merge-commit merge: !6683 merge hypot into master feat(hypot): 新增Hypot算子Ascend C实现(A2/A3) Created-by: doufloat Commit-by: doufloat Merged-by: cann-robot Description: ## 描述 新增 Hypot 算子(aclnnHypot),逐元素计算 sqrt(x1^2+x2^2)(二维欧几里得范数)。 - 数值稳定:以较大量级为基准的稳定变形,平方不提前上溢/下溢(fp32 (1e30,1e30)→≈1.414e30 有限值) - 数据类型:FLOAT / FLOAT16 / BFLOAT16,9 种输入 dtype 组合经 Type Promotion 归并 3 档 computeType;FP16/BF16 升 FP32 计算后回转(fp32→bf16 用 CAST_RINT) - 特殊值语义:inf 优先于 NaN、NaN 传播、±inf→+inf、双零得 +0、输出恒非负 - 场景:OneDim / MultiDimBroadcast × 3 dtype = 6 模板;多维广播按 scalar/NONE/ROW/COL/GENERIC 分模式向量化展开(紧凑连续布局) - 无 GM workspace(workspace=0),满足 >100M 元素峰值内存劣化 ≤5% 约束 ## 关联的Issue https://gitcode.com/cann/ops-math/pull/6683 ## 测试 验证平台:Ascend910_9362 / NpuArch 2201(Atlas A3),CANN 9.1.0;pre-commit 12 项钩子全过。 | 验证项 | 方法 | 结果 | |---|---|---| | 精度(双标杆) | ATK 三节点,498 用例 | **498/498 PASS**| | 内存 | ATK 直调 8 组(128M fp32/fp16/bf16 及广播/对照) | **8/8 SUCCESS**;128M fp32 峰值 Device 内存 1548 MB,workspace=0 | | 性能 | ATK pyaclnn + performance_device | raw **498/498(100%,门禁 PASS)**,中位比值 **1.19×**,最大值 **1.80×**,全场景(多维交叉/单侧/大 shape/launch-bound 小 shape)零回归 | ## 文档更新 - 新增 math/hypot/docs/aclnnHypot.md(aclnn 接口文档) ## 类型标签 - [ ] Bug修复 - [x] 新特性 - [x] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: cann/ops-math!6683 | 9 days ago |
Hypot
Applicable Products
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | × |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | × |
| Atlas inference products | × |
| Atlas training products | × |
Description
- Operator function: The operator computes the hypotenuse length (two-dimensional Euclidean norm) elementwise from the corresponding elements of two input tensors. The output is always nonnegative.
- Formula:
outi=selfi2+otheri2out_i = \sqrt{self_i^{2} + other_i^{2}} outi=selfi2+otheri2
- Numerical stability: The implementation scales inputs by the larger absolute value to avoid overflow or underflow in intermediate squared values. Two zero inputs produce
+0;inftakes precedence overNaN.
Parameters
| Parameter | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| self | Input | Input tensor self in the formula. | FLOAT, FLOAT16, and BFLOAT16 | ND |
| other | Input | Input tensor other in the formula. | FLOAT, FLOAT16, and BFLOAT16 | ND |
| out | Output | Output tensor out in the formula. | FLOAT, FLOAT16, and BFLOAT16 | ND |
- self and other can have different dtypes. Type promotion determines the output dtype. The output dtype is FLOAT if either input is FLOAT or if one input is FLOAT16 and the other is BFLOAT16. If both inputs have the same dtype, the output has that dtype.
Constraints
- The operator supports ND tensors with 0 to 8 dimensions. The input shapes must support broadcasting.
- The operator supports empty tensors and non-contiguous tensors.
- The operator does not support DOUBLE, integer types, BOOL, or complex types.
- This release provides only
aclnnHypotand the graph-modeHypotoperator. It does not provide an in-place API.
Invocation
| Invocation Method | Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_hypot | Invoke the Hypot operator using the aclnnHypot API. |
| Graph-mode invocation | test_geir_hypot | Invoke the Hypot operator by constructing a graph using the operator IR. |