pub trait IntTensorOps<B: Backend> {
Show 103 methods
// Required methods
fn int_empty(
shape: Shape,
device: &Device<B>,
dtype: IntDType,
) -> IntTensor<B>;
fn int_into_data(
tensor: IntTensor<B>,
) -> impl Future<Output = TensorData> + 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>, slices: &[Slice]) -> IntTensor<B>;
fn int_slice_assign(
tensor: IntTensor<B>,
slices: &[Slice],
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_matmul(lhs: IntTensor<B>, rhs: IntTensor<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_cumsum(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_cumprod(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_cummin(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>;
fn int_cummax(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>;
fn bitwise_and(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn bitwise_and_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn bitwise_or(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn bitwise_or_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn bitwise_xor(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn bitwise_xor_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>;
fn bitwise_not(tensor: IntTensor<B>) -> IntTensor<B>;
fn bitwise_left_shift(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn bitwise_left_shift_scalar(
lhs: IntTensor<B>,
rhs: IntElem<B>,
) -> IntTensor<B>;
fn bitwise_right_shift(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>;
fn bitwise_right_shift_scalar(
lhs: IntTensor<B>,
rhs: IntElem<B>,
) -> IntTensor<B>;
fn int_cast(tensor: IntTensor<B>, dtype: IntDType) -> IntTensor<B>;
fn int_unfold(
tensor: IntTensor<B>,
dim: usize,
size: usize,
step: usize,
) -> 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_powi_scalar_impl(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B> { ... }
fn int_powf_scalar(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B> { ... }
fn int_powf_scalar_impl(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_zeros(
shape: Shape,
device: &Device<B>,
dtype: IntDType,
) -> IntTensor<B> { ... }
fn int_ones(
shape: Shape,
device: &Device<B>,
dtype: IntDType,
) -> IntTensor<B> { ... }
fn int_full(
shape: Shape,
fill_value: IntElem<B>,
device: &Device<B>,
dtype: IntDType,
) -> 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_max_abs(tensor: IntTensor<B>) -> IntTensor<B> { ... }
fn int_max_abs_dim(tensor: IntTensor<B>, dim: usize) -> 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_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> + Send
fn int_into_data( tensor: IntTensor<B>, ) -> impl Future<Output = TensorData> + 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>,
slices: &[Slice],
value: IntTensor<B>,
) -> IntTensor<B>
fn int_slice_assign( tensor: IntTensor<B>, slices: &[Slice], 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_matmul(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
fn int_matmul(lhs: IntTensor<B>, rhs: IntTensor<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_cumsum(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_cumsum(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Computes the cumulative sum of elements along a dimension.
§Arguments
tensor- The tensor to compute the cumulative sum of.dim- The dimension along which to compute the cumulative sum.
§Returns
A tensor with the same shape where each element is the cumulative sum of all elements up to and including that position along the dimension.
Sourcefn int_cumprod(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_cumprod(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Computes the cumulative product of elements along a dimension.
§Arguments
tensor- The tensor to compute the cumulative product of.dim- The dimension along which to compute the cumulative product.
§Returns
A tensor with the same shape where each element is the cumulative product of all elements up to and including that position along the dimension.
Sourcefn int_cummin(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_cummin(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Computes the cumulative minimum of elements along a dimension.
§Arguments
tensor- The tensor to compute the cumulative minimum of.dim- The dimension along which to compute the cumulative minimum.
§Returns
A tensor with the same shape where each element is the minimum of all elements up to and including that position along the dimension.
Sourcefn int_cummax(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_cummax(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
Computes the cumulative maximum of elements along a dimension.
§Arguments
tensor- The tensor to compute the cumulative maximum of.dim- The dimension along which to compute the cumulative maximum.
§Returns
A tensor with the same shape where each element is the maximum of all elements up to and including that position along the dimension.
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.
Sourcefn bitwise_and(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
fn bitwise_and(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
Bitwise AND operation for Int Tensors
Sourcefn bitwise_and_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn bitwise_and_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Bitwise AND operation for Int Tensors with a scalar
Sourcefn bitwise_or(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
fn bitwise_or(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
Bitwise OR operation for Int Tensors
Sourcefn bitwise_or_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn bitwise_or_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Bitwise OR operation for Int Tensors with a scalar
Sourcefn bitwise_xor(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
fn bitwise_xor(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
Bitwise XOR operation for Int Tensors
Sourcefn bitwise_xor_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn bitwise_xor_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Bitwise XOR operation for Int Tensors with a scalar
Sourcefn bitwise_not(tensor: IntTensor<B>) -> IntTensor<B>
fn bitwise_not(tensor: IntTensor<B>) -> IntTensor<B>
Bitwise NOT operation for Int Tensors
Sourcefn bitwise_left_shift(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
fn bitwise_left_shift(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
Bitwise left shift operation for Int Tensors
Sourcefn bitwise_left_shift_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn bitwise_left_shift_scalar(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Bitwise left shift operation for Int Tensors with a scalar
Sourcefn bitwise_right_shift(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
fn bitwise_right_shift(lhs: IntTensor<B>, rhs: IntTensor<B>) -> IntTensor<B>
Bitwise right shift operation for Int Tensors
Sourcefn bitwise_right_shift_scalar(
lhs: IntTensor<B>,
rhs: IntElem<B>,
) -> IntTensor<B>
fn bitwise_right_shift_scalar( lhs: IntTensor<B>, rhs: IntElem<B>, ) -> IntTensor<B>
Bitwise right shift operation for Int Tensors with a scalar
Sourcefn int_unfold(
tensor: IntTensor<B>,
dim: usize,
size: usize,
step: usize,
) -> IntTensor<B>
fn int_unfold( tensor: IntTensor<B>, dim: usize, size: usize, step: usize, ) -> IntTensor<B>
Unfold windows along a dimension.
Returns a view of the tensor with all complete windows of size size in dimension dim;
where windows are advanced by step at each index.
The number of windows is max(0, (shape[dim] - size).ceil_div(step)).
§Arguments
tensor- The input tensor to unfold; of shape[pre=..., dim shape, post=...]dim- the selected dim.size- the size of each unfolded window.step- the step between each window.
§Returns
A tensor view with shape [pre=..., windows, size, post=...].
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>
Element-wise power with a scalar.
§Backend Implementors Note
A number of common exponent cases can be implemented with operations which are much cheaper than generic exponentiation.
This (Backend impl overridable) operation handles generic optimizations
for several common integer exponent cases; and then dispatches to
the (Backend impl overridable) Self::int_powi_scalar_impl
operation to handle the generic case.
§Arguments
lhs- The left-hand side tensor.rhs- The right-hand side scalar.
§Returns
The elements of lhs raised to the value of rhs.
Sourcefn int_powi_scalar_impl(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
fn int_powi_scalar_impl(lhs: IntTensor<B>, rhs: IntElem<B>) -> IntTensor<B>
Element-wise power with a scalar.
§Backend Implementors Note
This is the generic implementation of integer exponentiation
called by Self::int_powi_scalar in the fallback case.
By default, this performs a relatively expensive conversion to float,
exponentiation in float, and conversion back to int.
This reduces the minimal operation set for Backends,
at the cost of performance.
This is a good target for specialized optimizations in Backend implementations.
As a general rule, this should not be called directly.
§Arguments
lhs- The left-hand side tensor.rhs- The right-hand side scalar.
§Returns
The elements of lhs raised to the value of rhs.
Sourcefn int_powf_scalar(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B>
fn int_powf_scalar(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B>
Element-wise power with a floatTensor.
Handles a number of special cases, then calls Self::int_powf_scalar_impl.
§Arguments
lhs- The left-hand side tensor.rhs- The right-hand side scalar.
§Returns
The elements of lhs raised to the value of rhs. Result is an IntTensor.
Sourcefn int_powf_scalar_impl(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B>
fn int_powf_scalar_impl(lhs: IntTensor<B>, rhs: f32) -> IntTensor<B>
Element-wise power with a floatTensor.
Fallback handler for Self::int_powf_scalar.
§Arguments
lhs- The left-hand side tensor.rhs- The right-hand side scalar.
§Returns
The elements of lhs raised to the value of rhs. Result is an IntTensor.
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_full(
shape: Shape,
fill_value: IntElem<B>,
device: &Device<B>,
dtype: IntDType,
) -> IntTensor<B>
fn int_full( shape: Shape, fill_value: IntElem<B>, device: &Device<B>, dtype: IntDType, ) -> 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_max_abs(tensor: IntTensor<B>) -> IntTensor<B>
fn int_max_abs(tensor: IntTensor<B>) -> IntTensor<B>
Sourcefn int_max_abs_dim(tensor: IntTensor<B>, dim: usize) -> IntTensor<B>
fn int_max_abs_dim(tensor: IntTensor<B>, dim: usize) -> 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_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.