pub trait IntTensorOps<B: Backend> {
Show 85 methods
// Required methods
fn int_empty(shape: Shape, device: &Device<B>) -> IntTensor<B>;
fn int_into_data(
tensor: IntTensor<B>,
) -> impl Future<Output = TensorData> + 'static + Send;
fn int_from_data(data: TensorData, device: &Device<B>) -> IntTensor<B>;
fn int_device(tensor: &IntTensor<B>) -> Device<B>;
fn int_to_device(tensor: IntTensor<B>, device: &Device<B>) -> IntTensor<B>;
fn int_reshape(tensor: IntTensor<B>, shape: Shape) -> IntTensor<B>;
fn int_slice(tensor: IntTensor<B>, indices: &[Range<usize>]) -> IntTensor<B>;
fn int_slice_assign(
tensor: IntTensor<B>,
indices: &[Range<usize>],
value: IntTensor<B>,
) -> IntTensor<B>;
fn int_into_float(tensor: IntTensor<B>) -> FloatTensor<B>;
fn int_mask_where(
tensor: IntTensor<B>,
mask: BoolTensor<B>,
source: IntTensor<B>,
) -> IntTensor<B>;
fn int_mask_fill(
tensor: IntTensor<B>,
mask: BoolTensor<B>,
value: IntElem<B>,
) -> IntTensor<B>;
fn int_gather(
dim: usize,
tensor: IntTensor<B>,
indices: IntTensor<B>,
) -> IntTensor<B>;
fn int_scatter(
dim: usize,
tensor: IntTensor<B>,
indices: IntTensor<B>,
value: IntTensor<B>,
) -> IntTensor<B>;
fn int_select(
tensor: IntTensor<B>,
dim: usize,
indices: IntTensor<B>,
) -> IntTensor<B>;
fn int_select_assign(
tensor: IntTensor<B>,
dim: usize,
indices: IntTensor<B>,
value: IntTensor<B>,
) -> IntTensor<B>;
fn int_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>;
fn int_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>;
fn int_greater(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>;
fn int_greater_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>;
fn int_greater_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>;
fn int_greater_equal_elem(
lhs: IntTensor<B>,
rhs: IntElem<B>,
) -> BoolTensor<B>;
fn int_lower(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>;
fn int_lower_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>;
fn int_lower_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>;
fn int_lower_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>;
fn int_add(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn int_add_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn int_sub(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn int_sub_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn int_mul(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn int_mul_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn int_div(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn int_div_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn int_remainder(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn int_remainder_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn int_zeros(shape: Shape, device: &Device<B>) -> IntTensor<B>;
fn int_ones(shape: Shape, device: &Device<B>) -> IntTensor<B>;
fn int_sum(tensor: IntTensor<B>) -> IntTensor<B>;
fn int_sum_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_prod(tensor: IntTensor<B>) -> IntTensor<B>;
fn int_prod_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_mean_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_argmax(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_argmin(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_abs(tensor: IntTensor<B>) -> IntTensor<B>;
fn int_swap_dims(
tensor: IntTensor<B>,
dim1: usize,
dim2: usize,
) -> IntTensor<B>;
fn int_permute(tensor: IntTensor<B>, axes: &[usize]) -> IntTensor<B>;
fn int_flip(tensor: IntTensor<B>, axes: &[usize]) -> IntTensor<B>;
fn int_random(
shape: Shape,
distribution: Distribution,
device: &Device<B>,
) -> IntTensor<B>;
fn int_expand(tensor: IntTensor<B>, shape: Shape) -> IntTensor<B>;
// Provided methods
fn int_repeat_dim(
tensor: IntTensor<B>,
dim: usize,
times: usize,
) -> IntTensor<B> { ... }
fn int_cat(tensors: Vec<IntTensor<B>>, dim: usize) -> IntTensor<B> { ... }
fn int_not_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B> { ... }
fn int_not_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B> { ... }
fn int_powi(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B> { ... }
fn int_powf(lhs: IntTensor<B>, rhs: FloatTensor<B>) -> IntTensor<B> { ... }
fn int_powi_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B> { ... }
fn int_powf_scalar(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B> { ... }
fn int_clamp_min(tensor: IntTensor<B>, min: IntElem<B>) -> IntTensor<B> { ... }
fn int_clamp_max(tensor: IntTensor<B>, max: IntElem<B>) -> IntTensor<B> { ... }
fn int_clamp(
tensor: IntTensor<B>,
min: IntElem<B>,
max: IntElem<B>,
) -> IntTensor<B> { ... }
fn int_neg(tensor: IntTensor<B>) -> IntTensor<B> { ... }
fn int_full(
shape: Shape,
fill_value: IntElem<B>,
device: &Device<B>,
) -> IntTensor<B> { ... }
fn int_mean(tensor: IntTensor<B>) -> IntTensor<B> { ... }
fn int_max(tensor: IntTensor<B>) -> IntTensor<B> { ... }
fn int_max_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B> { ... }
fn int_max_dim_with_indices(
tensor: IntTensor<B>,
dim: usize,
) -> (IntTensor<B>, IntTensor<B>) { ... }
fn int_min(tensor: IntTensor<B>) -> IntTensor<B> { ... }
fn int_min_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B> { ... }
fn int_min_dim_with_indices(
tensor: IntTensor<B>,
dim: usize,
) -> (IntTensor<B>, IntTensor<B>) { ... }
fn int_transpose(tensor: IntTensor<B>) -> IntTensor<B> { ... }
fn int_narrow(
tensor: IntTensor<B>,
dim: usize,
start: usize,
length: usize,
) -> IntTensor<B> { ... }
fn int_chunk(
tensor: IntTensor<B>,
chunks: usize,
dim: usize,
) -> Vec<IntTensor<B>> ⓘ { ... }
fn int_split(
tensor: IntTensor<B>,
split_size: usize,
dim: usize,
) -> Vec<IntTensor<B>> ⓘ { ... }
fn int_split_with_sizes(
tensor: IntTensor<B>,
split_sizes: Vec<usize>,
dim: usize,
) -> Vec<IntTensor<B>> ⓘ { ... }
fn int_arange_step(
range: Range<i64>,
step: usize,
device: &Device<B>,
) -> IntTensor<B> { ... }
fn int_arange(range: Range<i64>, device: &Device<B>) -> IntTensor<B> { ... }
fn int_any(tensor: IntTensor<B>) -> BoolTensor<B> { ... }
fn int_any_dim(tensor: IntTensor<B>, dim: usize) -> BoolTensor<B> { ... }
fn int_all(tensor: IntTensor<B>) -> BoolTensor<B> { ... }
fn int_all_dim(tensor: IntTensor<B>, dim: usize) -> BoolTensor<B> { ... }
fn int_sign(tensor: IntTensor<B>) -> IntTensor<B> { ... }
fn int_sort(
tensor: IntTensor<B>,
dim: usize,
descending: bool,
) -> IntTensor<B> { ... }
fn int_sort_with_indices(
tensor: IntTensor<B>,
dim: usize,
descending: bool,
) -> (IntTensor<B>, IntTensor<B>) { ... }
fn int_argsort(
tensor: IntTensor<B>,
dim: usize,
descending: bool,
) -> IntTensor<B> { ... }
}Expand description
Int Tensor API for basic and numeric operations, see tensor for documentation on each function.
Required Methods§
Sourcefn int_into_data(
tensor: IntTensor<B>,
) -> impl Future<Output = TensorData> + 'static + Send
fn int_into_data( tensor: IntTensor<B>, ) -> impl Future<Output = TensorData> + 'static + Send
Sourcefn int_from_data(data: TensorData, device: &Device<B>) -> IntTensor<B>
fn int_from_data(data: TensorData, device: &Device<B>) -> IntTensor<B>
Sourcefn int_device(tensor: &IntTensor<B>) -> Device<B>
fn int_device(tensor: &IntTensor<B>) -> Device<B>
Sourcefn int_to_device(tensor: IntTensor<B>, device: &Device<B>) -> IntTensor<B>
fn int_to_device(tensor: IntTensor<B>, device: &Device<B>) -> IntTensor<B>
Moves the tensor to the given device.
Sourcefn int_reshape(tensor: IntTensor<B>, shape: Shape) -> IntTensor<B>
fn int_reshape(tensor: IntTensor<B>, shape: Shape) -> IntTensor<B>
Sourcefn int_slice_assign(
tensor: IntTensor<B>,
indices: &[Range<usize>],
value: IntTensor<B>,
) -> IntTensor<B>
fn int_slice_assign( tensor: IntTensor<B>, indices: &[Range<usize>], value: IntTensor<B>, ) -> IntTensor<B>
Sourcefn int_into_float(tensor: IntTensor<B>) -> FloatTensor<B>
fn int_into_float(tensor: IntTensor<B>) -> FloatTensor<B>
Sourcefn int_mask_where(
tensor: IntTensor<B>,
mask: BoolTensor<B>,
source: IntTensor<B>,
) -> IntTensor<B>
fn int_mask_where( tensor: IntTensor<B>, mask: BoolTensor<B>, source: IntTensor<B>, ) -> IntTensor<B>
Sourcefn int_mask_fill(
tensor: IntTensor<B>,
mask: BoolTensor<B>,
value: IntElem<B>,
) -> IntTensor<B>
fn int_mask_fill( tensor: IntTensor<B>, mask: BoolTensor<B>, value: IntElem<B>, ) -> IntTensor<B>
Sourcefn int_gather(
dim: usize,
tensor: IntTensor<B>,
indices: IntTensor<B>,
) -> IntTensor<B>
fn int_gather( dim: usize, tensor: IntTensor<B>, indices: IntTensor<B>, ) -> IntTensor<B>
Gather elements from the tensor at the given indices.
§Arguments
dim- The dimension to gather from.tensor- The tensor.indices- The indices.
Sourcefn int_scatter(
dim: usize,
tensor: IntTensor<B>,
indices: IntTensor<B>,
value: IntTensor<B>,
) -> IntTensor<B>
fn int_scatter( dim: usize, tensor: IntTensor<B>, indices: IntTensor<B>, value: IntTensor<B>, ) -> IntTensor<B>
Sourcefn int_select_assign(
tensor: IntTensor<B>,
dim: usize,
indices: IntTensor<B>,
value: IntTensor<B>,
) -> IntTensor<B>
fn int_select_assign( tensor: IntTensor<B>, dim: usize, indices: IntTensor<B>, value: IntTensor<B>, ) -> IntTensor<B>
Sourcefn int_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
fn int_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
fn int_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
Sourcefn int_greater(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
fn int_greater(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_greater_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
fn int_greater_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
Sourcefn int_greater_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
fn int_greater_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_greater_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
fn int_greater_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
Sourcefn int_lower(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
fn int_lower(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_lower_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
fn int_lower_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
Sourcefn int_lower_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
fn int_lower_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_lower_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
fn int_lower_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
Sourcefn int_add_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn int_add_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Sourcefn int_sub_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn int_sub_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Sourcefn int_mul_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn int_mul_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Sourcefn int_div_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn int_div_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Sourcefn int_remainder(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
fn int_remainder(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
Sourcefn int_remainder_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn int_remainder_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Sourcefn int_sum_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_sum_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Sourcefn int_prod_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_prod_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Sourcefn int_mean_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_mean_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Sourcefn int_argmax(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_argmax(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Sourcefn int_argmin(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_argmin(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Sourcefn int_permute(tensor: IntTensor<B>, axes: &[usize]) -> IntTensor<B>
fn int_permute(tensor: IntTensor<B>, axes: &[usize]) -> IntTensor<B>
Sourcefn int_flip(tensor: IntTensor<B>, axes: &[usize]) -> IntTensor<B>
fn int_flip(tensor: IntTensor<B>, axes: &[usize]) -> IntTensor<B>
Reverse the order of elements in a tensor along the given axes.
§Arguments
tensor- The tensor to reverse.axes- The axes to reverse.
The tensor with the elements reversed.
Sourcefn int_random(
shape: Shape,
distribution: Distribution,
device: &Device<B>,
) -> IntTensor<B>
fn int_random( shape: Shape, distribution: Distribution, device: &Device<B>, ) -> IntTensor<B>
Sourcefn int_expand(tensor: IntTensor<B>, shape: Shape) -> IntTensor<B>
fn int_expand(tensor: IntTensor<B>, shape: Shape) -> IntTensor<B>
Broadcasts the int tensor to the given shape.
Provided Methods§
Sourcefn int_not_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
fn int_not_equal(lhs: IntTensor<B>, rhs: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_not_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
fn int_not_equal_elem(lhs: IntTensor<B>, rhs: IntElem<B>) -> BoolTensor<B>
Sourcefn int_powf(lhs: IntTensor<B>, rhs: FloatTensor<B>) -> IntTensor<B>
fn int_powf(lhs: IntTensor<B>, rhs: FloatTensor<B>) -> IntTensor<B>
Sourcefn int_powi_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn int_powi_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Sourcefn int_powf_scalar(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B>
fn int_powf_scalar(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B>
Sourcefn int_clamp_min(tensor: IntTensor<B>, min: IntElem<B>) -> IntTensor<B>
fn int_clamp_min(tensor: IntTensor<B>, min: IntElem<B>) -> IntTensor<B>
Sourcefn int_clamp_max(tensor: IntTensor<B>, max: IntElem<B>) -> IntTensor<B>
fn int_clamp_max(tensor: IntTensor<B>, max: IntElem<B>) -> IntTensor<B>
Sourcefn int_max_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_max_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Sourcefn int_max_dim_with_indices(
tensor: IntTensor<B>,
dim: usize,
) -> (IntTensor<B>, IntTensor<B>)
fn int_max_dim_with_indices( tensor: IntTensor<B>, dim: usize, ) -> (IntTensor<B>, IntTensor<B>)
Sourcefn int_min_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_min_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Sourcefn int_min_dim_with_indices(
tensor: IntTensor<B>,
dim: usize,
) -> (IntTensor<B>, IntTensor<B>)
fn int_min_dim_with_indices( tensor: IntTensor<B>, dim: usize, ) -> (IntTensor<B>, IntTensor<B>)
Sourcefn int_transpose(tensor: IntTensor<B>) -> IntTensor<B>
fn int_transpose(tensor: IntTensor<B>) -> IntTensor<B>
Sourcefn int_narrow(
tensor: IntTensor<B>,
dim: usize,
start: usize,
length: usize,
) -> IntTensor<B>
fn int_narrow( tensor: IntTensor<B>, dim: usize, start: usize, length: usize, ) -> IntTensor<B>
Returns a new tensor with the given dimension narrowed to the given range.
§Arguments
dim- The dimension along which the tensor will be narrowed.start- The starting point of the given range.length- The ending point of the given range.
§Panics
- If the dimension is greater than the number of dimensions of the tensor.
- If the given range exceeds the number of elements on the given dimension.
§Returns
A new tensor with the given dimension narrowed to the given range.
Sourcefn int_split_with_sizes(
tensor: IntTensor<B>,
split_sizes: Vec<usize>,
dim: usize,
) -> Vec<IntTensor<B>> ⓘ
fn int_split_with_sizes( tensor: IntTensor<B>, split_sizes: Vec<usize>, dim: usize, ) -> Vec<IntTensor<B>> ⓘ
Sourcefn int_any(tensor: IntTensor<B>) -> BoolTensor<B>
fn int_any(tensor: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_any_dim(tensor: IntTensor<B>, dim: usize) -> BoolTensor<B>
fn int_any_dim(tensor: IntTensor<B>, dim: usize) -> BoolTensor<B>
Tests if any element in the int tensor evaluates to True along a given dimension dim.
§Arguments
tensor- The tensor to test.dim- The axis along which to test.
§Returns
A boolean tensor Tensor<B, D, Bool> with the same size as input tensor, except in the dim axis
where the size is 1. The elem in the dim axis is True if any element along this dim in the input
evaluates to True, False otherwise.
Sourcefn int_all(tensor: IntTensor<B>) -> BoolTensor<B>
fn int_all(tensor: IntTensor<B>) -> BoolTensor<B>
Sourcefn int_all_dim(tensor: IntTensor<B>, dim: usize) -> BoolTensor<B>
fn int_all_dim(tensor: IntTensor<B>, dim: usize) -> BoolTensor<B>
Tests if all elements in the int tensor evaluate to True along a given dimension dim.
§Arguments
tensor- The tensor to test.dim- The axis along which to test.
§Returns
A boolean tensor Tensor<B, D, Bool> with the same size as input tensor, except in the dim axis
where the size is 1. The elem in the dim axis is True if all elements along this dim in the input
evaluates to True, False otherwise.
Sourcefn int_sort(tensor: IntTensor<B>, dim: usize, descending: bool) -> IntTensor<B>
fn int_sort(tensor: IntTensor<B>, dim: usize, descending: bool) -> IntTensor<B>
Sort the elements of the input tensor by value along a given dimension.
This sort is unstable (i.e., may reorder equal elements).
§Arguments
tensor- The input tensor.dim- The axis along which to sort.descending- The sorting order.
§Returns
A tensor with the same shape as the input tensor, where the elements are sorted by value.
Sourcefn int_sort_with_indices(
tensor: IntTensor<B>,
dim: usize,
descending: bool,
) -> (IntTensor<B>, IntTensor<B>)
fn int_sort_with_indices( tensor: IntTensor<B>, dim: usize, descending: bool, ) -> (IntTensor<B>, IntTensor<B>)
Sort the elements of the input tensor by value along a given dimension.
This sort is unstable (i.e., may reorder equal elements).
§Arguments
tensor- The input tensor.dim- The axis along which to sort.
§Returns
A tensor with the same shape as the input tensor and corresponding indices, where the elements are sorted by value and the indices map back to the original input tensor.
Sourcefn int_argsort(
tensor: IntTensor<B>,
dim: usize,
descending: bool,
) -> IntTensor<B>
fn int_argsort( tensor: IntTensor<B>, dim: usize, descending: bool, ) -> IntTensor<B>
Returns the indices that sort the elements of the input tensor by value
along a given dimension.
This sort is unstable (i.e., may reorder equal elements).
§Arguments
tensor- The input tensor.dim- The axis along which to sort.descending- The sorting order.
§Returns
A tensor with the same shape as the input tensor the indices map back to the original input tensor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.