Compress - version 9#
This page documents version 9 of operator Compress. See Compress for the latest version (since version 11).
Domain:
ai.onnxSince version: 9
Selects slices from an input tensor along a given axis value passed.
In case axis is not provided, input is flattened before elements being selected.
Compress behaves like numpy.compress: https://docs.scipy.org/doc/numpy/reference/generated/numpy.compress.html
Inputs
input (T): Tensor of rank r >= 1.
condition (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 alone 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 (T): Tensor of rank r if axis is specified. Otherwise output is a Tensor of rank 1.
Attributes
axis (int): (Optional) Axis along which to take slices. If not specified, input is flattened before elements being selected.
Type Constraints
T: Constrain input and output types to all tensor types. Allowed types: tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8).
T1: Constrain to boolean tensors. Allowed types: tensor(bool).