shlogg · Early preview
Super Kai (Kazuya Ito) @superkai_kazuya

Mastering PyTorch Select() Function For Efficient Tensor Operations

select() can get the 0D or more D view tensor of elements selected with an index, removing one dimension from the tensor. It's used with torch or a tensor, requiring input, dim and index as arguments.

Buy Me a Coffee☕
*Memos:

My post explains index_select().
My post explains masked_select().

select() can get the 0D or more D view tensor of the zero or more elements selected with an index, removing one dimension from the 0D or more D tensor of zero or more elements as shown below:
*Memos:

select() can be used with torch or a tensor.
The 1st argument(input) with torch or using a tensor(Required-Type:tensor of int, float, complex or bool). *It must be the 0D or more D tensor of zero or more elements.
The 2nd argument with torch or the 1st argument with a tensor is dim(Required-Type:int).
T...