BitShift

Description

Bitwise shift operator performs element-wise operation. For each input element, if the attribute β€œdirection” is β€œRIGHT”, this operator moves its binary representation toward the right side so that the input value is effectively decreased. If the attribute β€œdirection” is β€œLEFT”, bits of binary representation moves toward the left side, which results the increase of its actual value. The input X is the tensor to be shifted and another input Y specifies the amounts of shifting. For example, if β€œdirection” is β€œRight”, X is [1, 4], and S is [1, 1], the corresponding output Z would be [0, 2]. If β€œdirection” is β€œLEFT” with X=[1, 2] and S=[1, 2], the corresponding output Y would be [2, 8].

Because this operator supports Numpy-style broadcasting, X’s and Y’s shapes are not necessarily identical. This operator supportsΒ multidirectional (i.e., Numpy-style) broadcasting; for more details please checkΒ Broadcasting in ONNX.

 

Input parameters

 

specified_outputs_name :Β array, this parameter lets you manually assign custom names to the output tensors of a node.

Β Graphs in :Β cluster, ONNX model architecture.

X (heterogeneous) – T : object, first operand, input to be shifted.
Y (heterogeneous)Β – T : object, second operand, amounts of shift.

Β Parameters :Β cluster,

directionΒ :Β enum, direction of moving bits. It can be either β€œRIGHT” (for right shift) or β€œLEFT” (for left shift).
Default value β€œRIGHT”.
Β training?Β :Β boolean, whether the layer is in training mode (can store data for backward).
Default value β€œTrue”.
Β lda coeff :Β float, defines the coefficient by which the loss derivative will be multiplied before being sent to the previous layer (since during the backward run we go backwards).
Default value β€œ1”.

Β name (optional) :Β string, name of the node.

Output parameters

 

Β Z (heterogeneous) – T : object, the output tensor.

Type Constraints

T in (tensor(uint16),Β tensor(uint32),Β tensor(uint64),Β tensor(uint8)) : Constrain input and output types to integer tensors.

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).
Table of Contents