module onnxrt.ops_cpu.op_cum_sum
#
Short summary#
module mlprodict.onnxrt.ops_cpu.op_cum_sum
Runtime operator.
Classes#
class |
truncated documentation |
---|---|
CumSum ====== Performs cumulative sum of the input elements along the given axis. By default, it will do the sum inclusively … |
Properties#
property |
truncated documentation |
---|---|
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of modified parameters. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns all parameters in a dictionary. |
Methods#
method |
truncated documentation |
---|---|
Documentation#
Runtime operator.
- class mlprodict.onnxrt.ops_cpu.op_cum_sum.CumSum(onnx_node, desc=None, **options)#
Bases:
OpRun
Performs cumulative sum of the input elements along the given axis. By default, it will do the sum inclusively meaning the first element is copied as is. Through an exclusive attribute, this behavior can change to exclude the first element. It can also perform summation in the opposite direction of the axis. For that, set reverse attribute to 1.
Example: `` input_x = [1, 2, 3] axis=0 output = [1, 3, 6] exclusive=1 output = [0, 1, 3] exclusive=0 reverse=1 output = [6, 5, 3] exclusive=1 reverse=1 output = [5, 3, 0] ``
Attributes
exclusive: If set to 1 will return exclusive sum in which the top element is not included. In other terms, if set to 1, the j-th output element would be the sum of the first (j-1) elements. Otherwise, it would be the sum of the first j elements. Default value is
nameexclusivei0typeINT
(INT)reverse: If set to 1 will perform the sums in reverse direction. Default value is
namereversei0typeINT
(INT)
Inputs
x (heterogeneous)T: An input tensor that is to be processed.
axis (heterogeneous)T2: A 0-D tensor. Must be in the range [-rank(x), rank(x)-1]. Negative value means counting dimensions from the back.
Outputs
y (heterogeneous)T: Output tensor of the same type as ‘x’ with cumulative sums of the x’s elements
Type Constraints
T tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16): Constrain input and output types to high-precision numeric tensors.
T2 tensor(int32), tensor(int64): axis tensor can be int32 or int64 only
Version
Onnx name: CumSum
This version of the operator has been available since version 14.
Runtime implementation:
CumSum
- __init__(onnx_node, desc=None, **options)#
- _run(x, *axis, attributes=None, verbose=0, fLOG=None)#
Should be overwritten.
- to_python(inputs)#
Returns a python code equivalent to this operator.
- Parameters:
inputs – inputs name
- Returns:
imports, python code, both as strings