Where¶
Where - 16¶
Version¶
name: Where (GitHub)
domain:
mainsince_version:
16function:
Falsesupport_level:
SupportType.COMMONshape inference:
True
This version of the operator has been available since version 16.
Summary¶
Return elements, either from X or Y, depending on condition. Where behaves like numpy.where with three parameters.
This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.
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 in (
tensor(bool)):Constrain to boolean tensors.
T in (
tensor(bfloat16),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)):Constrain input and output types to all tensor types (including bfloat).
Where - 9¶
Version¶
name: Where (GitHub)
domain:
mainsince_version:
9function:
Falsesupport_level:
SupportType.COMMONshape inference:
True
This version of the operator has been available since version 9.
Summary¶
Return elements, either from X or Y, depending on condition. Where behaves like numpy.where with three parameters.
This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.
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 in (
tensor(bool)):Constrain to boolean tensors.
T in (
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)):Constrain input and output types to all tensor types.