Trait burn::tensor::ops::IntTensorOps
pub trait IntTensorOps<B>where
B: Backend,{
Show 83 methods
// Required methods
fn int_empty(
shape: Shape,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive;
fn int_shape(tensor: &<B as Backend>::IntTensorPrimitive) -> Shape;
fn int_into_data(
tensor: <B as Backend>::IntTensorPrimitive,
) -> impl Future<Output = TensorData> + Send;
fn int_from_data(
data: TensorData,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive;
fn int_device(
tensor: &<B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::Device;
fn int_to_device(
tensor: <B as Backend>::IntTensorPrimitive,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive;
fn int_reshape(
tensor: <B as Backend>::IntTensorPrimitive,
shape: Shape,
) -> <B as Backend>::IntTensorPrimitive;
fn int_slice(
tensor: <B as Backend>::IntTensorPrimitive,
indices: &[Range<usize>],
) -> <B as Backend>::IntTensorPrimitive;
fn int_slice_assign(
tensor: <B as Backend>::IntTensorPrimitive,
indices: &[Range<usize>],
value: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_into_float(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive;
fn int_mask_where(
tensor: <B as Backend>::IntTensorPrimitive,
mask: <B as Backend>::BoolTensorPrimitive,
source: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_mask_fill(
tensor: <B as Backend>::IntTensorPrimitive,
mask: <B as Backend>::BoolTensorPrimitive,
value: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive;
fn int_gather(
dim: usize,
tensor: <B as Backend>::IntTensorPrimitive,
indices: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_scatter(
dim: usize,
tensor: <B as Backend>::IntTensorPrimitive,
indices: <B as Backend>::IntTensorPrimitive,
value: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_select(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
indices: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_select_assign(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
indices: <B as Backend>::IntTensorPrimitive,
value: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_greater(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_greater_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_greater_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_greater_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_lower(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_lower_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_lower_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_lower_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive;
fn int_add(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_add_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive;
fn int_sub(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_sub_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive;
fn int_mul(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_mul_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive;
fn int_div(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_div_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive;
fn int_remainder_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive;
fn int_zeros(
shape: Shape,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive;
fn int_ones(
shape: Shape,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive;
fn int_sum(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_sum_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive;
fn int_prod(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_prod_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive;
fn int_mean_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive;
fn int_argmax(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive;
fn int_argmin(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive;
fn int_abs(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn int_swap_dims(
tensor: <B as Backend>::IntTensorPrimitive,
dim1: usize,
dim2: usize,
) -> <B as Backend>::IntTensorPrimitive;
fn int_permute(
tensor: <B as Backend>::IntTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::IntTensorPrimitive;
fn int_flip(
tensor: <B as Backend>::IntTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::IntTensorPrimitive;
fn int_random(
shape: Shape,
distribution: Distribution,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive;
fn int_expand(
tensor: <B as Backend>::IntTensorPrimitive,
shape: Shape,
) -> <B as Backend>::IntTensorPrimitive;
// Provided methods
fn int_repeat_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
times: usize,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_cat(
tensors: Vec<<B as Backend>::IntTensorPrimitive>,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_not_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn int_not_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn int_powi(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_powf(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_powi_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_powf_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: f32,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_clamp_min(
tensor: <B as Backend>::IntTensorPrimitive,
min: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_clamp_max(
tensor: <B as Backend>::IntTensorPrimitive,
max: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_clamp(
tensor: <B as Backend>::IntTensorPrimitive,
min: <B as Backend>::IntElem,
max: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_neg(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_full(
shape: Shape,
fill_value: <B as Backend>::IntElem,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_mean(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_max(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_max_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_max_dim_with_indices(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive) { ... }
fn int_min(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_min_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_min_dim_with_indices(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive) { ... }
fn int_transpose(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_narrow(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
start: usize,
length: usize,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_chunk(
tensor: <B as Backend>::IntTensorPrimitive,
chunks: usize,
dim: usize,
) -> Vec<<B as Backend>::IntTensorPrimitive> { ... }
fn int_arange_step(
range: Range<i64>,
step: usize,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_arange(
range: Range<i64>,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_any(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn int_any_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn int_all(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn int_all_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn int_sign(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_sort(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive { ... }
fn int_sort_with_indices(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive) { ... }
fn int_argsort(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive { ... }
}
Expand description
Int Tensor API for basic and numeric operations, see tensor for documentation on each function.
Required Methods§
fn int_empty(
shape: Shape,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_empty( shape: Shape, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
fn int_shape(tensor: &<B as Backend>::IntTensorPrimitive) -> Shape
fn int_shape(tensor: &<B as Backend>::IntTensorPrimitive) -> Shape
fn int_into_data(
tensor: <B as Backend>::IntTensorPrimitive,
) -> impl Future<Output = TensorData> + Send
fn int_into_data( tensor: <B as Backend>::IntTensorPrimitive, ) -> impl Future<Output = TensorData> + Send
fn int_from_data(
data: TensorData,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_from_data( data: TensorData, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
fn int_device(
tensor: &<B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::Device
fn int_device( tensor: &<B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::Device
fn int_to_device(
tensor: <B as Backend>::IntTensorPrimitive,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_to_device( tensor: <B as Backend>::IntTensorPrimitive, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
Moves the tensor to the given device.
fn int_reshape(
tensor: <B as Backend>::IntTensorPrimitive,
shape: Shape,
) -> <B as Backend>::IntTensorPrimitive
fn int_reshape( tensor: <B as Backend>::IntTensorPrimitive, shape: Shape, ) -> <B as Backend>::IntTensorPrimitive
fn int_slice(
tensor: <B as Backend>::IntTensorPrimitive,
indices: &[Range<usize>],
) -> <B as Backend>::IntTensorPrimitive
fn int_slice( tensor: <B as Backend>::IntTensorPrimitive, indices: &[Range<usize>], ) -> <B as Backend>::IntTensorPrimitive
fn int_slice_assign(
tensor: <B as Backend>::IntTensorPrimitive,
indices: &[Range<usize>],
value: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_slice_assign( tensor: <B as Backend>::IntTensorPrimitive, indices: &[Range<usize>], value: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_into_float(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn int_into_float( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
fn int_mask_where(
tensor: <B as Backend>::IntTensorPrimitive,
mask: <B as Backend>::BoolTensorPrimitive,
source: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_mask_where( tensor: <B as Backend>::IntTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, source: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_mask_fill(
tensor: <B as Backend>::IntTensorPrimitive,
mask: <B as Backend>::BoolTensorPrimitive,
value: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_mask_fill( tensor: <B as Backend>::IntTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_gather(
dim: usize,
tensor: <B as Backend>::IntTensorPrimitive,
indices: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_gather( dim: usize, tensor: <B as Backend>::IntTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
Gather elements from the tensor at the given indices.
§Arguments
dim
- The dimension to gather from.tensor
- The tensor.indices
- The indices.
fn int_scatter(
dim: usize,
tensor: <B as Backend>::IntTensorPrimitive,
indices: <B as Backend>::IntTensorPrimitive,
value: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_scatter( dim: usize, tensor: <B as Backend>::IntTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, value: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_select(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
indices: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_select( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_select_assign(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
indices: <B as Backend>::IntTensorPrimitive,
value: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_select_assign( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, value: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive
fn int_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive
fn int_greater(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_greater( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_greater_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive
fn int_greater_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive
fn int_greater_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_greater_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_greater_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive
fn int_greater_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive
fn int_lower(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_lower( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_lower_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive
fn int_lower_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive
fn int_lower_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_lower_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_lower_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive
fn int_lower_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive
fn int_add(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_add( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_add_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_add_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_sub(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_sub( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_sub_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_sub_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_mul(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_mul( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_mul_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_mul_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_div(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_div( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_div_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_div_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_remainder_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_remainder_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_zeros(
shape: Shape,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_zeros( shape: Shape, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
fn int_sum(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_sum( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_sum_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_sum_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_prod(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_prod( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_prod_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_prod_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_mean_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_mean_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_argmax(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_argmax( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_argmin(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_argmin( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_abs(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_abs( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_swap_dims(
tensor: <B as Backend>::IntTensorPrimitive,
dim1: usize,
dim2: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_swap_dims( tensor: <B as Backend>::IntTensorPrimitive, dim1: usize, dim2: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_permute(
tensor: <B as Backend>::IntTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::IntTensorPrimitive
fn int_permute( tensor: <B as Backend>::IntTensorPrimitive, axes: &[usize], ) -> <B as Backend>::IntTensorPrimitive
fn int_flip(
tensor: <B as Backend>::IntTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::IntTensorPrimitive
fn int_flip( tensor: <B as Backend>::IntTensorPrimitive, axes: &[usize], ) -> <B as Backend>::IntTensorPrimitive
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.
fn int_random(
shape: Shape,
distribution: Distribution,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_random( shape: Shape, distribution: Distribution, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
fn int_expand(
tensor: <B as Backend>::IntTensorPrimitive,
shape: Shape,
) -> <B as Backend>::IntTensorPrimitive
fn int_expand( tensor: <B as Backend>::IntTensorPrimitive, shape: Shape, ) -> <B as Backend>::IntTensorPrimitive
Broadcasts the int tensor
to the given shape
.
Provided Methods§
fn int_repeat_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
times: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_repeat_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_cat(
tensors: Vec<<B as Backend>::IntTensorPrimitive>,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_cat( tensors: Vec<<B as Backend>::IntTensorPrimitive>, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_not_equal(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_not_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_not_equal_elem(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::BoolTensorPrimitive
fn int_not_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive
fn int_powi(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_powi( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_powf(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::FloatTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_powf( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_powi_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_powi_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_powf_scalar(
lhs: <B as Backend>::IntTensorPrimitive,
rhs: f32,
) -> <B as Backend>::IntTensorPrimitive
fn int_powf_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: f32, ) -> <B as Backend>::IntTensorPrimitive
fn int_clamp_min(
tensor: <B as Backend>::IntTensorPrimitive,
min: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_clamp_min( tensor: <B as Backend>::IntTensorPrimitive, min: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_clamp_max(
tensor: <B as Backend>::IntTensorPrimitive,
max: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_clamp_max( tensor: <B as Backend>::IntTensorPrimitive, max: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_clamp(
tensor: <B as Backend>::IntTensorPrimitive,
min: <B as Backend>::IntElem,
max: <B as Backend>::IntElem,
) -> <B as Backend>::IntTensorPrimitive
fn int_clamp( tensor: <B as Backend>::IntTensorPrimitive, min: <B as Backend>::IntElem, max: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive
fn int_neg(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_neg( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_full(
shape: Shape,
fill_value: <B as Backend>::IntElem,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_full( shape: Shape, fill_value: <B as Backend>::IntElem, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
fn int_mean(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_mean( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_max(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_max( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_max_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_max_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_max_dim_with_indices(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
fn int_max_dim_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
fn int_min(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_min( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_min_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_min_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive
fn int_min_dim_with_indices(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
fn int_min_dim_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
fn int_transpose(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_transpose( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_narrow(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
start: usize,
length: usize,
) -> <B as Backend>::IntTensorPrimitive
fn int_narrow( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::IntTensorPrimitive
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.
fn int_chunk(
tensor: <B as Backend>::IntTensorPrimitive,
chunks: usize,
dim: usize,
) -> Vec<<B as Backend>::IntTensorPrimitive>
fn int_chunk( tensor: <B as Backend>::IntTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::IntTensorPrimitive>
fn int_arange_step(
range: Range<i64>,
step: usize,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_arange_step( range: Range<i64>, step: usize, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
fn int_arange(
range: Range<i64>,
device: &<B as Backend>::Device,
) -> <B as Backend>::IntTensorPrimitive
fn int_arange( range: Range<i64>, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive
fn int_any(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_any( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_any_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn int_any_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
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.
fn int_all(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn int_all( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn int_all_dim(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn int_all_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
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.
fn int_sign(
tensor: <B as Backend>::IntTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn int_sign( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn int_sort(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive
fn int_sort( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive
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.
fn int_sort_with_indices(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
fn int_sort_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)
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.
fn int_argsort(
tensor: <B as Backend>::IntTensorPrimitive,
dim: usize,
descending: bool,
) -> <B as Backend>::IntTensorPrimitive
fn int_argsort( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::IntTensorPrimitive
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.