tensorly.where

where(condition, x, y)

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

Parameters

condition : tensor

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

x, y : tensor

Values from which to choose.

Returns

tensor