module onnxrt.ops_cpu.op_where
#
Short summary#
module mlprodict.onnxrt.ops_cpu.op_where
Runtime operator.
Classes#
class |
truncated documentation |
---|---|
Where ===== Return elements, either from X or Y, depending on condition. Where behaves like [numpy.where](https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html) … |
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_where.Where(onnx_node, desc=None, **options)#
Bases:
OpRun
Return elements, either from X or Y, depending on condition. Where behaves like [numpy.where](https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html) with three parameters.
This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.
History - Version 16 adds bfloat16 to the types allowed (for the second and third parameter).
Inputs
condition (heterogeneous)B: When True (nonzero), yield X, otherwise yield Y
X (heterogeneous)T: values selected at indices where condition is True
Y (heterogeneous)T: values selected at indices where condition is False
Outputs
output (heterogeneous)T: Tensor of shape equal to the broadcasted shape of condition, X, and Y.
Type Constraints
B tensor(bool): Constrain to boolean tensors.
T tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128): Constrain input and output types to all tensor types (including bfloat).
Version
Onnx name: Where
This version of the operator has been available since version 16.
Runtime implementation:
Where
- __init__(onnx_node, desc=None, **options)#
- _run(condition, x, y, attributes=None, verbose=0, fLOG=None)#
Should be overwritten.