cuda.tile.where#
- cuda.tile.where(cond, x, y, /)#
Returns elements chosen from x or y depending on condition.
- Parameters:
- Return type:
Examples
>>> cond = ct.arange(4, dtype=ct.int32) >>> cond = cond > 2 >>> x_true = ct.full((4,), 1.0, dtype=ct.float32) >>> x_false = ct.full((4,), -1.0, dtype=ct.float32) >>> y = ct.where(cond, x_true, x_false) >>> y [1., 1., -1., -1.] >>> z = ct.where(cond, 1.0, -1.0) >>> z [1., 1., -1., -1.]