文件最后提交记录最后更新时间
10 天前
27 天前
27 天前
5 个月前
27 天前
27 天前
27 天前
7 个月前
10 天前
README

Threshold

产品支持情况

产品 是否支持
Ascend 950PR/Ascend 950DT
Atlas A3 训练系列产品/Atlas A3 推理系列产品 ×
Atlas A2 训练系列产品/Atlas A2 推理系列产品 ×
Atlas 200I/500 A2 推理产品 ×
Atlas 推理系列产品 ×
Atlas 训练系列产品 ×

功能说明

  • 算子功能:对输入x进行阈值操作。当x中的elements大于threshold时,返回1;否则,返回0。

  • 计算公式:

y=(x>threshold)  ?  1:0y = (x > threshold) \; ? \; 1 : 0

参数说明

参数名 输入/输出/属性 描述 数据类型 数据格式
x 输入 待进行threshold计算的入参,公式中的x。 FLOAT、FLOAT16、BFLOAT16 ND
y 输出 threshold计算后的出参,公式中的y。 FLOAT、FLOAT16、BFLOAT16 ND
threshold 属性 阈值,x中大于此值的元素输出1,否则输出0。默认值为0.0。 FLOAT -

约束说明

  • 输入输出为任意维度张量(ND格式)。
  • 输入输出数据类型必须一致。
  • 输出值为离散值(0.0或1.0),与Golden结果bit-exact一致。
  • NaN输入输出0.0(NaN 与任意值比较恒为False)。
  • +Inf输入输出1.0(+Inf > threshold 恒为True)。
  • -Inf输入输出0.0(-Inf > threshold 恒为False)。

调用说明

调用方式 调用样例 说明
aclnn调用 test_aclnn_threshold 参见算子调用完成算子编译和验证。
图模式调用 test_geir_threshold