pymoose.mux
pymoose.mux#
- pymoose.mux(selector, x, y, placement=None)[source]#
Multiplex two tensors according to some condition.
This op allows for static control-flow of elements coming from two tensors. For boolean tensor
sand arbitrary tensorsxandy, the operation is equivalent tos * (x - y) + y.- Parameters
selector – Boolean tensor representing the control-flow condition.
x – A tensor to fill from when the selector condition is 1.
y – A tensor to fill from when the selector condition is 0.
placement – An optional
Placementto pin this operation to.
- Result:
A tensor with elements of
xandymultiplexed according to the condition given byselector.