c4696245创建于 2025年11月15日历史提交

SinhCustom算子样例

概述

样例概述:本样例介绍了如何利用ATVC实现临时Tensor参与计算的SinhCustom单算子并完成算子验证

  • 算子功能:sinh
  • 使用的ATVC模板:Elementwise
  • 调用方式:Kernel直调

样例支持AI处理器型号

  • Ascend 910C
  • Ascend 910B

算子描述

SinhCustom算子数学计算公式:y=exp⁡(x)−exp⁡(−x)2y = \frac{\exp(x) - \exp(-x)}{2}

SinhCustom算子规格:

算子类型(OpType)SinhCustom
算子输入
nameshapedata typeformat
x8 * 2048floatND
算子输出
y8 * 2048floatND
核函数名SinhCustom

目录结构

文件名 描述
sinh_custom.cpp SinhCustom算子代码实现以及调用样例

算子运行

在ascendc-api-adv代码仓目录下执行:

cd ./ops_templates/atvc/examples
bash run_examples.sh sinh_custom