Trait burn::tensor::ops::BoolTensorOps
pub trait BoolTensorOps<B>where
B: Backend,{
Show 29 methods
// Required methods
fn bool_empty(
shape: Shape,
device: &<B as Backend>::Device,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_shape(tensor: &<B as Backend>::BoolTensorPrimitive) -> Shape;
fn bool_into_data(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> impl Future<Output = TensorData> + Send;
fn bool_from_data(
data: TensorData,
device: &<B as Backend>::Device,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_into_int(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive;
fn bool_into_float(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive;
fn bool_device(
tensor: &<B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::Device;
fn bool_to_device(
tensor: <B as Backend>::BoolTensorPrimitive,
device: &<B as Backend>::Device,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_reshape(
tensor: <B as Backend>::BoolTensorPrimitive,
shape: Shape,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_slice(
tensor: <B as Backend>::BoolTensorPrimitive,
ranges: &[Range<usize>],
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_slice_assign(
tensor: <B as Backend>::BoolTensorPrimitive,
ranges: &[Range<usize>],
value: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_equal(
lhs: <B as Backend>::BoolTensorPrimitive,
rhs: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_not(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_swap_dims(
tensor: <B as Backend>::BoolTensorPrimitive,
dim1: usize,
dim2: usize,
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_permute(
tensor: <B as Backend>::BoolTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_flip(
tensor: <B as Backend>::BoolTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::BoolTensorPrimitive;
fn bool_expand(
tensor: <B as Backend>::BoolTensorPrimitive,
shape: Shape,
) -> <B as Backend>::BoolTensorPrimitive;
// Provided methods
fn bool_repeat_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
times: usize,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_cat(
tensors: Vec<<B as Backend>::BoolTensorPrimitive>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_not_equal(
lhs: <B as Backend>::BoolTensorPrimitive,
rhs: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_transpose(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_narrow(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
start: usize,
length: usize,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_chunk(
tensor: <B as Backend>::BoolTensorPrimitive,
chunks: usize,
dim: usize,
) -> Vec<<B as Backend>::BoolTensorPrimitive> { ... }
fn bool_any(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_any_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_all(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_all_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive { ... }
fn bool_argwhere(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> impl Future<Output = <B as Backend>::IntTensorPrimitive> + Send { ... }
fn bool_nonzero(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> impl Future<Output = Vec<<B as Backend>::IntTensorPrimitive>> + Send { ... }
}
Expand description
Bool Tensor API for basic operations, see tensor for documentation on each function.
Required Methods§
fn bool_empty(
shape: Shape,
device: &<B as Backend>::Device,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_empty( shape: Shape, device: &<B as Backend>::Device, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_shape(tensor: &<B as Backend>::BoolTensorPrimitive) -> Shape
fn bool_shape(tensor: &<B as Backend>::BoolTensorPrimitive) -> Shape
fn bool_into_data(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> impl Future<Output = TensorData> + Send
fn bool_into_data( tensor: <B as Backend>::BoolTensorPrimitive, ) -> impl Future<Output = TensorData> + Send
fn bool_from_data(
data: TensorData,
device: &<B as Backend>::Device,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_from_data( data: TensorData, device: &<B as Backend>::Device, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_into_int(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::IntTensorPrimitive
fn bool_into_int( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive
fn bool_into_float(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::FloatTensorPrimitive
fn bool_into_float( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive
fn bool_device(
tensor: &<B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::Device
fn bool_device( tensor: &<B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::Device
fn bool_to_device(
tensor: <B as Backend>::BoolTensorPrimitive,
device: &<B as Backend>::Device,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_to_device( tensor: <B as Backend>::BoolTensorPrimitive, device: &<B as Backend>::Device, ) -> <B as Backend>::BoolTensorPrimitive
Moves the tensor to the device.
fn bool_reshape(
tensor: <B as Backend>::BoolTensorPrimitive,
shape: Shape,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_reshape( tensor: <B as Backend>::BoolTensorPrimitive, shape: Shape, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_slice(
tensor: <B as Backend>::BoolTensorPrimitive,
ranges: &[Range<usize>],
) -> <B as Backend>::BoolTensorPrimitive
fn bool_slice( tensor: <B as Backend>::BoolTensorPrimitive, ranges: &[Range<usize>], ) -> <B as Backend>::BoolTensorPrimitive
fn bool_slice_assign(
tensor: <B as Backend>::BoolTensorPrimitive,
ranges: &[Range<usize>],
value: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_slice_assign( tensor: <B as Backend>::BoolTensorPrimitive, ranges: &[Range<usize>], value: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_equal(
lhs: <B as Backend>::BoolTensorPrimitive,
rhs: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_equal( lhs: <B as Backend>::BoolTensorPrimitive, rhs: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_not(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_not( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_swap_dims(
tensor: <B as Backend>::BoolTensorPrimitive,
dim1: usize,
dim2: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_swap_dims( tensor: <B as Backend>::BoolTensorPrimitive, dim1: usize, dim2: usize, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_permute(
tensor: <B as Backend>::BoolTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::BoolTensorPrimitive
fn bool_permute( tensor: <B as Backend>::BoolTensorPrimitive, axes: &[usize], ) -> <B as Backend>::BoolTensorPrimitive
fn bool_flip(
tensor: <B as Backend>::BoolTensorPrimitive,
axes: &[usize],
) -> <B as Backend>::BoolTensorPrimitive
fn bool_flip( tensor: <B as Backend>::BoolTensorPrimitive, axes: &[usize], ) -> <B as Backend>::BoolTensorPrimitive
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 bool_expand(
tensor: <B as Backend>::BoolTensorPrimitive,
shape: Shape,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_expand( tensor: <B as Backend>::BoolTensorPrimitive, shape: Shape, ) -> <B as Backend>::BoolTensorPrimitive
Broadcasts the bool tensor
to the given shape
.
Provided Methods§
fn bool_repeat_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
times: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_repeat_dim( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_cat(
tensors: Vec<<B as Backend>::BoolTensorPrimitive>,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_cat( tensors: Vec<<B as Backend>::BoolTensorPrimitive>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_not_equal(
lhs: <B as Backend>::BoolTensorPrimitive,
rhs: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_not_equal( lhs: <B as Backend>::BoolTensorPrimitive, rhs: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_transpose(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_transpose( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_narrow(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
start: usize,
length: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_narrow( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::BoolTensorPrimitive
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 bool_chunk(
tensor: <B as Backend>::BoolTensorPrimitive,
chunks: usize,
dim: usize,
) -> Vec<<B as Backend>::BoolTensorPrimitive>
fn bool_chunk( tensor: <B as Backend>::BoolTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::BoolTensorPrimitive>
fn bool_any(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_any( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_any_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_any_dim( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Tests if any element in the boolean 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 bool_all(
tensor: <B as Backend>::BoolTensorPrimitive,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_all( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive
fn bool_all_dim(
tensor: <B as Backend>::BoolTensorPrimitive,
dim: usize,
) -> <B as Backend>::BoolTensorPrimitive
fn bool_all_dim( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive
Tests if all elements in the boolean 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.