ThresholdV2
产品支持情况
| 产品 | 是否支持 |
|---|---|
| Ascend 950PR/Ascend 950DT | √ |
| Atlas A3 训练系列产品/Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品/Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | × |
| Atlas 推理系列产品 | × |
| Atlas 训练系列产品 | √ |
功能说明
-
算子功能:对输入x进行阈值操作。当x中的elements大于threshold时,返回elements;否则,返回value。
-
计算公式:
out(x)={x,x>thresholdvalue,otherwiseout(x) = \begin{cases} x, & x\gt threshold \\ value, & otherwise \end{cases}
参数说明
| 参数名 | 输入/输出/属性 | 描述 | 数据类型 | 数据格式 |
|---|---|---|---|---|
| x | 输入 | 对应公式中的x | BFLOAT16、FLOAT16、FLOAT、INT8、INT32、INT64、UINT8 | ND |
| threshold | 输入 | 对应公式中的threshold | BFLOAT16、FLOAT16、FLOAT、INT8、INT32、INT64、UINT8 | ND |
| value | 输入 | 对应公式中的value | BFLOAT16、FLOAT16、FLOAT、INT8、INT32、INT64、UINT8 | ND |
| y | 输出 | 公式中的输出张量 | BFLOAT16、FLOAT16、FLOAT、INT8、INT32、INT64、UINT8 | ND |
约束说明
无
调用说明
| 调用方式 | 样例代码 | 说明 |
|---|---|---|
| 图模式 | test_geir_threshold_v2.cpp | 通过算子IR构图方式调用ThresholdV2算子。 |
| aclnn调用 | test_aclnn_threshold | 通过aclnnThreshold接口方式调用ThresholdV2算子。 |
| aclnn调用 | test_aclnn_inplace_threshold | 通过aclnnInplaceThreshold接口方式调用ThresholdV2算子。 |