module onnxrt.ops_cpu.op_compress
#
Short summary#
module mlprodict.onnxrt.ops_cpu.op_compress
Runtime operator.
Classes#
class |
truncated documentation |
---|---|
Compress ======== Selects slices from an input tensor along a given axis where condition evaluates to True for each axis … |
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_compress.Compress(onnx_node, desc=None, **options)#
Bases:
OpRun
Selects slices from an input tensor along a given axis where condition evaluates to True for each axis index. In case axis is not provided, input is flattened before elements are selected. Compress behaves like numpy.compress: https://docs.scipy.org/doc/numpy/reference/generated/numpy.compress.html
Attributes
axis: (Optional) Axis along which to take slices. If not specified, input is flattened before elements being selected. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input). default value cannot be automatically retrieved (INT)
Inputs
input (heterogeneous)T: Tensor of rank r >= 1.
condition (heterogeneous)T1: Rank 1 tensor of booleans to indicate which slices or data elements to be selected. Its length can be less than the input length along the axis or the flattened input size if axis is not specified. In such cases data slices or elements exceeding the condition length are discarded.
Outputs
output (heterogeneous)T: Tensor of rank r if axis is specified. Otherwise output is a Tensor of rank 1.
Type Constraints
T tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128): Constrain input and output types to all tensor types.
T1 tensor(bool): Constrain to boolean tensors.
Version
Onnx name: Compress
This version of the operator has been available since version 11.
Runtime implementation:
Compress
- __init__(onnx_node, desc=None, **options)#
- _run(x, condition, 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