module onnxrt.ops_cpu.op_where#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_where

Short summary#

module mlprodict.onnxrt.ops_cpu.op_where

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

Where

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

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__

_infer_shapes

_infer_types

_run

Documentation#

Runtime operator.

source on GitHub

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)#
_infer_shapes(condition, x, y)#

Should be overwritten.

source on GitHub

_infer_types(condition, x, y)#

Should be overwritten.

source on GitHub

_run(condition, x, y, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub