Trait burn_tensor::ops::IntTensorOps
source · pub trait IntTensorOps<B: Backend> {
Show 59 methods
// Required methods
fn int_empty<const D: usize>(
shape: Shape<D>,
device: &Device<B>
) -> IntTensor<B, D>;
fn int_shape<const D: usize>(tensor: &IntTensor<B, D>) -> Shape<D>;
fn int_into_data<const D: usize>(
tensor: IntTensor<B, D>
) -> Reader<Data<IntElem<B>, D>>;
fn int_from_data<const D: usize>(
data: Data<IntElem<B>, D>,
device: &Device<B>
) -> IntTensor<B, D>;
fn int_device<const D: usize>(tensor: &IntTensor<B, D>) -> Device<B>;
fn int_to_device<const D: usize>(
tensor: IntTensor<B, D>,
device: &Device<B>
) -> IntTensor<B, D>;
fn int_reshape<const D1: usize, const D2: usize>(
tensor: IntTensor<B, D1>,
shape: Shape<D2>
) -> IntTensor<B, D2>;
fn int_slice<const D1: usize, const D2: usize>(
tensor: IntTensor<B, D1>,
indices: [Range<usize>; D2]
) -> IntTensor<B, D1>;
fn int_slice_assign<const D1: usize, const D2: usize>(
tensor: IntTensor<B, D1>,
indices: [Range<usize>; D2],
value: IntTensor<B, D1>
) -> IntTensor<B, D1>;
fn int_into_float<const D: usize>(
tensor: IntTensor<B, D>
) -> FloatTensor<B, D>;
fn int_mask_where<const D: usize>(
tensor: IntTensor<B, D>,
mask: BoolTensor<B, D>,
source: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_mask_fill<const D: usize>(
tensor: IntTensor<B, D>,
mask: BoolTensor<B, D>,
value: IntElem<B>
) -> IntTensor<B, D>;
fn int_gather<const D: usize>(
dim: usize,
tensor: IntTensor<B, D>,
indices: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_scatter<const D: usize>(
dim: usize,
tensor: IntTensor<B, D>,
indices: IntTensor<B, D>,
value: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_select<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize,
indices: IntTensor<B, 1>
) -> IntTensor<B, D>;
fn int_select_assign<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize,
indices: IntTensor<B, 1>,
value: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_cat<const D: usize>(
tensors: Vec<IntTensor<B, D>>,
dim: usize
) -> IntTensor<B, D>;
fn int_equal<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>;
fn int_equal_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>;
fn int_greater<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>;
fn int_greater_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>;
fn int_greater_equal<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>;
fn int_greater_equal_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>;
fn int_lower<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>;
fn int_lower_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>;
fn int_lower_equal<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>;
fn int_lower_equal_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>;
fn int_add<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_add_scalar<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> IntTensor<B, D>;
fn int_sub<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_sub_scalar<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> IntTensor<B, D>;
fn int_mul<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_mul_scalar<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> IntTensor<B, D>;
fn int_div<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> IntTensor<B, D>;
fn int_div_scalar<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> IntTensor<B, D>;
fn int_zeros<const D: usize>(
shape: Shape<D>,
device: &Device<B>
) -> IntTensor<B, D>;
fn int_ones<const D: usize>(
shape: Shape<D>,
device: &Device<B>
) -> IntTensor<B, D>;
fn int_sum<const D: usize>(tensor: IntTensor<B, D>) -> IntTensor<B, 1>;
fn int_sum_dim<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> IntTensor<B, D>;
fn int_mean_dim<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> IntTensor<B, D>;
fn int_argmax<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> IntTensor<B, D>;
fn int_argmin<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> IntTensor<B, D>;
fn int_abs<const D: usize>(tensor: IntTensor<B, D>) -> IntTensor<B, D>;
fn int_swap_dims<const D: usize>(
tensor: IntTensor<B, D>,
dim1: usize,
dim2: usize
) -> IntTensor<B, D>;
// Provided methods
fn int_to_data<const D: usize>(
tensor: &IntTensor<B, D>
) -> Reader<Data<IntElem<B>, D>> { ... }
fn int_repeat<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize,
times: usize
) -> IntTensor<B, D> { ... }
fn int_clamp_min<const D: usize>(
tensor: IntTensor<B, D>,
min: IntElem<B>
) -> IntTensor<B, D> { ... }
fn int_clamp_max<const D: usize>(
tensor: IntTensor<B, D>,
max: IntElem<B>
) -> IntTensor<B, D> { ... }
fn int_clamp<const D: usize>(
tensor: IntTensor<B, D>,
min: IntElem<B>,
max: IntElem<B>
) -> IntTensor<B, D> { ... }
fn int_neg<const D: usize>(tensor: IntTensor<B, D>) -> IntTensor<B, D> { ... }
fn int_full<const D: usize>(
shape: Shape<D>,
fill_value: IntElem<B>,
device: &Device<B>
) -> IntTensor<B, D> { ... }
fn int_mean<const D: usize>(tensor: IntTensor<B, D>) -> IntTensor<B, 1> { ... }
fn int_max<const D: usize>(tensor: IntTensor<B, D>) -> IntTensor<B, 1> { ... }
fn int_max_dim<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> IntTensor<B, D> { ... }
fn int_max_dim_with_indices<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> (IntTensor<B, D>, IntTensor<B, D>) { ... }
fn int_min<const D: usize>(tensor: IntTensor<B, D>) -> IntTensor<B, 1> { ... }
fn int_min_dim<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> IntTensor<B, D> { ... }
fn int_min_dim_with_indices<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> (IntTensor<B, D>, IntTensor<B, D>) { ... }
fn int_transpose<const D: usize>(tensor: IntTensor<B, D>) -> IntTensor<B, D> { ... }
}Expand description
Int Tensor API for basic and numeric operations, see tensor for documentation on each function.
Required Methods§
sourcefn int_from_data<const D: usize>(
data: Data<IntElem<B>, D>,
device: &Device<B>
) -> IntTensor<B, D>
fn int_from_data<const D: usize>( data: Data<IntElem<B>, D>, device: &Device<B> ) -> IntTensor<B, D>
sourcefn int_device<const D: usize>(tensor: &IntTensor<B, D>) -> Device<B>
fn int_device<const D: usize>(tensor: &IntTensor<B, D>) -> Device<B>
sourcefn int_to_device<const D: usize>(
tensor: IntTensor<B, D>,
device: &Device<B>
) -> IntTensor<B, D>
fn int_to_device<const D: usize>( tensor: IntTensor<B, D>, device: &Device<B> ) -> IntTensor<B, D>
Moves the tensor to the given device.
sourcefn int_reshape<const D1: usize, const D2: usize>(
tensor: IntTensor<B, D1>,
shape: Shape<D2>
) -> IntTensor<B, D2>
fn int_reshape<const D1: usize, const D2: usize>( tensor: IntTensor<B, D1>, shape: Shape<D2> ) -> IntTensor<B, D2>
sourcefn int_slice<const D1: usize, const D2: usize>(
tensor: IntTensor<B, D1>,
indices: [Range<usize>; D2]
) -> IntTensor<B, D1>
fn int_slice<const D1: usize, const D2: usize>( tensor: IntTensor<B, D1>, indices: [Range<usize>; D2] ) -> IntTensor<B, D1>
sourcefn int_slice_assign<const D1: usize, const D2: usize>(
tensor: IntTensor<B, D1>,
indices: [Range<usize>; D2],
value: IntTensor<B, D1>
) -> IntTensor<B, D1>
fn int_slice_assign<const D1: usize, const D2: usize>( tensor: IntTensor<B, D1>, indices: [Range<usize>; D2], value: IntTensor<B, D1> ) -> IntTensor<B, D1>
sourcefn int_into_float<const D: usize>(tensor: IntTensor<B, D>) -> FloatTensor<B, D>
fn int_into_float<const D: usize>(tensor: IntTensor<B, D>) -> FloatTensor<B, D>
sourcefn int_mask_where<const D: usize>(
tensor: IntTensor<B, D>,
mask: BoolTensor<B, D>,
source: IntTensor<B, D>
) -> IntTensor<B, D>
fn int_mask_where<const D: usize>( tensor: IntTensor<B, D>, mask: BoolTensor<B, D>, source: IntTensor<B, D> ) -> IntTensor<B, D>
sourcefn int_mask_fill<const D: usize>(
tensor: IntTensor<B, D>,
mask: BoolTensor<B, D>,
value: IntElem<B>
) -> IntTensor<B, D>
fn int_mask_fill<const D: usize>( tensor: IntTensor<B, D>, mask: BoolTensor<B, D>, value: IntElem<B> ) -> IntTensor<B, D>
sourcefn int_gather<const D: usize>(
dim: usize,
tensor: IntTensor<B, D>,
indices: IntTensor<B, D>
) -> IntTensor<B, D>
fn int_gather<const D: usize>( dim: usize, tensor: IntTensor<B, D>, indices: IntTensor<B, D> ) -> IntTensor<B, D>
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<const D: usize>(
dim: usize,
tensor: IntTensor<B, D>,
indices: IntTensor<B, D>,
value: IntTensor<B, D>
) -> IntTensor<B, D>
fn int_scatter<const D: usize>( dim: usize, tensor: IntTensor<B, D>, indices: IntTensor<B, D>, value: IntTensor<B, D> ) -> IntTensor<B, D>
sourcefn int_select<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize,
indices: IntTensor<B, 1>
) -> IntTensor<B, D>
fn int_select<const D: usize>( tensor: IntTensor<B, D>, dim: usize, indices: IntTensor<B, 1> ) -> IntTensor<B, D>
sourcefn int_select_assign<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize,
indices: IntTensor<B, 1>,
value: IntTensor<B, D>
) -> IntTensor<B, D>
fn int_select_assign<const D: usize>( tensor: IntTensor<B, D>, dim: usize, indices: IntTensor<B, 1>, value: IntTensor<B, D> ) -> IntTensor<B, D>
sourcefn int_equal<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>
fn int_equal<const D: usize>( lhs: IntTensor<B, D>, rhs: IntTensor<B, D> ) -> BoolTensor<B, D>
sourcefn int_equal_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>
fn int_equal_elem<const D: usize>( lhs: IntTensor<B, D>, rhs: IntElem<B> ) -> BoolTensor<B, D>
sourcefn int_greater<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>
fn int_greater<const D: usize>( lhs: IntTensor<B, D>, rhs: IntTensor<B, D> ) -> BoolTensor<B, D>
sourcefn int_greater_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>
fn int_greater_elem<const D: usize>( lhs: IntTensor<B, D>, rhs: IntElem<B> ) -> BoolTensor<B, D>
sourcefn int_greater_equal<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>
fn int_greater_equal<const D: usize>( lhs: IntTensor<B, D>, rhs: IntTensor<B, D> ) -> BoolTensor<B, D>
sourcefn int_greater_equal_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>
fn int_greater_equal_elem<const D: usize>( lhs: IntTensor<B, D>, rhs: IntElem<B> ) -> BoolTensor<B, D>
sourcefn int_lower<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>
fn int_lower<const D: usize>( lhs: IntTensor<B, D>, rhs: IntTensor<B, D> ) -> BoolTensor<B, D>
sourcefn int_lower_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>
fn int_lower_elem<const D: usize>( lhs: IntTensor<B, D>, rhs: IntElem<B> ) -> BoolTensor<B, D>
sourcefn int_lower_equal<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntTensor<B, D>
) -> BoolTensor<B, D>
fn int_lower_equal<const D: usize>( lhs: IntTensor<B, D>, rhs: IntTensor<B, D> ) -> BoolTensor<B, D>
sourcefn int_lower_equal_elem<const D: usize>(
lhs: IntTensor<B, D>,
rhs: IntElem<B>
) -> BoolTensor<B, D>
fn int_lower_equal_elem<const D: usize>( lhs: IntTensor<B, D>, rhs: IntElem<B> ) -> BoolTensor<B, D>
Provided Methods§
sourcefn int_repeat<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize,
times: usize
) -> IntTensor<B, D>
fn int_repeat<const D: usize>( tensor: IntTensor<B, D>, dim: usize, times: usize ) -> IntTensor<B, D>
sourcefn int_clamp_min<const D: usize>(
tensor: IntTensor<B, D>,
min: IntElem<B>
) -> IntTensor<B, D>
fn int_clamp_min<const D: usize>( tensor: IntTensor<B, D>, min: IntElem<B> ) -> IntTensor<B, D>
sourcefn int_clamp_max<const D: usize>(
tensor: IntTensor<B, D>,
max: IntElem<B>
) -> IntTensor<B, D>
fn int_clamp_max<const D: usize>( tensor: IntTensor<B, D>, max: IntElem<B> ) -> IntTensor<B, D>
sourcefn int_clamp<const D: usize>(
tensor: IntTensor<B, D>,
min: IntElem<B>,
max: IntElem<B>
) -> IntTensor<B, D>
fn int_clamp<const D: usize>( tensor: IntTensor<B, D>, min: IntElem<B>, max: IntElem<B> ) -> IntTensor<B, D>
sourcefn int_full<const D: usize>(
shape: Shape<D>,
fill_value: IntElem<B>,
device: &Device<B>
) -> IntTensor<B, D>
fn int_full<const D: usize>( shape: Shape<D>, fill_value: IntElem<B>, device: &Device<B> ) -> IntTensor<B, D>
sourcefn int_max_dim_with_indices<const D: usize>(
tensor: IntTensor<B, D>,
dim: usize
) -> (IntTensor<B, D>, IntTensor<B, D>)
fn int_max_dim_with_indices<const D: usize>( tensor: IntTensor<B, D>, dim: usize ) -> (IntTensor<B, D>, IntTensor<B, D>)
Object Safety§
This trait is not object safe.