# select

`import { select } from "destack";`

Select tensor elements from `thenValue` or `elseValue`.

Per-lane conditional select.

Returns a[i] if mask[i] is true, otherwise b[i], for each lane.

```ds title="select"
export declare function select<T, const Rank: usize>(mask: Tensor<boolean, Rank>, thenValue: Tensor<T, Rank>, elseValue: Tensor<T, Rank>, options?: TensorOutputOptions<T, Rank> | undefined): Tensor<T, Rank>
```

[language/library/src/tensor/ops.ds:106:111](https://github.com/destack-sh/destack/blob/main/language/library/src/tensor/ops.ds#L106-L111)

```ds title="select"
export declare function select<T, const N: usize>(mask: Vector<boolean, N>, a: Vector<T, N>, b: Vector<T, N>): Vector<T, N>
```

[language/library/src/math/vector.ds:51:55](https://github.com/destack-sh/destack/blob/main/language/library/src/math/vector.ds#L51-L55)
