FilesLast commitLast update
18 days ago
2 months ago
17 days ago
3 days ago
6 days ago
5 days ago
3 days ago
1 month ago
5 days ago
README

ClipByValue

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

  • Operator function: limits all elements of the input to the range [clipValueMin,clipValueMax]. If an element is greater than clipValueMax, it is limited to clipValueMax. If an element is less than clipValueMin, it is limited to clipValueMin. Otherwise, it equals the element itself.
  • Computation formula:

yi=max(min(xi,max_valuei),min_valuei){y}_{i} = max(min({{x}_{i}},{max\_value}_{i}),{min\_value}_{i})

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input tensor. INT8, INT16, INT32, INT64, UINT8, UINT16,
FLOAT16, FLOAT, DOUBLE, BOOL, BFLOAT16, COMPLEX32, COMPLEX64, COMPLEX128
ND
clip_value_min Input Minimum value that limits the element range. Same as the input tensor x ND
clip_value_max Input Maximum value that limits the element range. Same as the input tensor x ND
y Output Output tensor after clipping the input tensor x. Same as the input tensor x ND

Constraint Description

None

Invocation Description

Invocation Method Sample Code Description
Graph-mode invocation test_geir_clip_by_value Invokes the clip_by_value operator by building a graph through the operator IR.