module onnxrt.ops_cpu.op_bitshift#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_bitshift

Short summary#

module mlprodict.onnxrt.ops_cpu.op_bitshift

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

BitShift

BitShift ======== Bitwise shift operator performs element-wise operation. For each input element, if the attribute “direction” …

Properties#

property

truncated documentation

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

Methods#

method

truncated documentation

__init__

constructor

Documentation#

Runtime operator.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_bitshift.BitShift(onnx_node, desc=None, **options)#

Bases: OpRunBinaryNumpy


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.

Attributes

  • direction (required): Direction of moving bits. It can be either “RIGHT” (for right shift) or “LEFT” (for left shift). default value cannot be automatically retrieved (STRING)

Inputs

  • X (heterogeneous)T: First operand, input to be shifted.

  • Y (heterogeneous)T: Second operand, amounts of shift.

Outputs

  • Z (heterogeneous)T: Output tensor

Type Constraints

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

Version

Onnx name: BitShift

This version of the operator has been available since version 11.

Runtime implementation: BitShift

constructor

__init__(onnx_node, desc=None, **options)#

constructor