tensorly.where

where(condition, x, y)

Return elements, either from x or y, depending on condition.

Parameters
conditiontensor

When True, yield element from x, otherwise from y.

x, ytensor

Values from which to choose.

Returns
tensor