pymoose.select
pymoose.select#
- pymoose.select(x, axis, index, placement=None)[source]#
Select elements along some axis of a tensor according to some index tensor.
- Parameters
x – A tensor.
axis – The dimension along which to index.
index – A 1-d boolean tensor such that
len(index) == x.shape[axis].placement – An optional
Placementto pin this operation to.
- Returns
Copy of the tensor
x, with the values along axis filtered such thatx[..., i, ...]is kept iffindex[i] == 1.