pub trait IndexSlicing where
    Self: Sized
{
Show 15 methods fn cat(&self, tensors: &[Self], dim: usize) -> Self;
fn chunk(&self, chunks: usize, dim: usize) -> Vec<Self>;
fn gather(&self, dim: usize, index: &Self) -> Self;
fn index_select(&self, dim: usize, index: &Self) -> Self;
fn index_exclude(&self, dim: usize, index: &Self) -> Self;
fn reshape(&self, new_shape: &[usize]) -> Self;
fn split(&self, sections: &[usize], dim: usize) -> Vec<Self>;
fn squeeze(&self, dim: Option<usize>) -> Self;
fn stack(&self, tensors: &[Self], dim: usize) -> Self;
fn t(&self) -> Self;
fn take(&self, index: &[usize]) -> Self;
fn permute(&self, dims: &[usize]) -> Self;
fn unsqueeze(&self, dim: usize) -> Self;
fn conditional_select(&self, x: &Self, y: &Self) -> Self;
fn repeat(&self, sizes: &[usize]) -> Self;
}

Required methods

Concatenates the given sequence of seq tensors in the given dimension. The input tensor should all have the same size except on the given dimension. The output tensor will have all the same size as the input except the given dimension, which will be the sum of the inputs on the given dimension. Apply cat on [tensor(5, 3, 2), tensor(5, 7, 2), ] will get a tensor(5, 10, 2).

Splits a tensor into a specific number of chunks.

Pick elements on the given dimension by the index given in index, and gather them in the output. A restriction is that self size and index size should be the same.

Select on dim and collect those subtensor by index.

Inverse of index_select, remove those subtensor by index along dim.

Just change the index boundary.

Inverse of cat(), split tensor along dim dimension, the length of each section on dim is specified by sections.

Remove dimension with length of 1.

Stack tensor with the same size along a new dimension specified by dim. The difference from cat is that cat don’t create new dimension.

Transpose

Returns a new tensor with the elements of input at the given indices. The input tensor is treated as if it were viewed as a 1-D tensor. The result takes the same shape as the indices.

Add size 1 dimension at dim.

Self is the bool condition, at each position of self, select from x if self at the position is positive or zero, Otherwise , use value from y if self at the position is negative. The restriction is that, self, x, and y all have the same size.

Implementors