RightShift
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: computes the bitwise right shift of the input tensors x and y element-wise.
-
Computation formula:
zi=xi>>yiz_i = x_i >> y_i
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | The input x is a k-dimensional tensor. It is the input parameter for the right_shift computation, which is x_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
| y | Input | Input parameter for the right_shift computation, which is y_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
| negMode | Attribute | An optional integer attribute. The value is 0 or 1, and the default value is 0. If the value is 0 and y is negative, the computation is performed as a shift of 0 bits. If the value is 1 and y is negative, the computation is performed as a shift of the maximum number of bits. | INT | - |
| z | Output | Output parameter for the right_shift computation, which is z_i in the formula. | INT8, INT16, INT32, INT64, UINT8, UINT16, UINT32, UINT64 | ND |
Constraint Description
None
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_rightshift | Invokes the rightshift operator through the aclnnRightshift API. |
| Graph-mode invocation | test_geir_right_shift | Invokes the RightShift operator by building a graph through the operator IR. |