Struct burn_tensor::Float
source · pub struct Float;
Expand description
A type-level representation of the kind of a float tensor
Trait Implementations§
source§impl<B: Backend> BasicOps<B> for Float
impl<B: Backend> BasicOps<B> for Float
source§fn empty<const D: usize>(
shape: Shape<D>,
device: &B::Device
) -> Self::Primitive<D>
fn empty<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>
Creates an empty tensor with the given shape. Read more
source§fn shape<const D: usize>(tensor: &Self::Primitive<D>) -> Shape<D>
fn shape<const D: usize>(tensor: &Self::Primitive<D>) -> Shape<D>
Returns the shape of the tensor. Read more
source§fn reshape<const D1: usize, const D2: usize>(
tensor: Self::Primitive<D1>,
shape: Shape<D2>
) -> Self::Primitive<D2>
fn reshape<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, shape: Shape<D2> ) -> Self::Primitive<D2>
Reshapes the tensor. Read more
source§fn slice<const D1: usize, const D2: usize>(
tensor: Self::Primitive<D1>,
ranges: [Range<usize>; D2]
) -> Self::Primitive<D1>
fn slice<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, ranges: [Range<usize>; D2] ) -> Self::Primitive<D1>
Select tensor elements corresponding for the given ranges. Read more
source§fn slice_assign<const D1: usize, const D2: usize>(
tensor: Self::Primitive<D1>,
ranges: [Range<usize>; D2],
value: Self::Primitive<D1>
) -> Self::Primitive<D1>
fn slice_assign<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, ranges: [Range<usize>; D2], value: Self::Primitive<D1> ) -> Self::Primitive<D1>
Assigns the given value to the tensor elements corresponding for the given ranges. Read more
source§fn device<const D: usize>(tensor: &Self::Primitive<D>) -> <B as Backend>::Device
fn device<const D: usize>(tensor: &Self::Primitive<D>) -> <B as Backend>::Device
Returns the device on which the tensor is allocated. Read more
source§fn to_device<const D: usize>(
tensor: Self::Primitive<D>,
device: &<B as Backend>::Device
) -> Self::Primitive<D>
fn to_device<const D: usize>( tensor: Self::Primitive<D>, device: &<B as Backend>::Device ) -> Self::Primitive<D>
Moves the tensor to the given device. Read more
source§fn into_data<const D: usize>(tensor: Self::Primitive<D>) -> Data<Self::Elem, D>
fn into_data<const D: usize>(tensor: Self::Primitive<D>) -> Data<Self::Elem, D>
Extracts the data from the tensor. Read more
source§fn from_data<const D: usize>(
data: Data<Self::Elem, D>,
device: &B::Device
) -> Self::Primitive<D>
fn from_data<const D: usize>( data: Data<Self::Elem, D>, device: &B::Device ) -> Self::Primitive<D>
Creates a tensor from the given data. Read more
source§fn repeat<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize,
times: usize
) -> Self::Primitive<D>
fn repeat<const D: usize>( tensor: Self::Primitive<D>, dim: usize, times: usize ) -> Self::Primitive<D>
Repeat the tensor along the given dimension. Read more
source§fn cat<const D: usize>(
vectors: Vec<Self::Primitive<D>>,
dim: usize
) -> Self::Primitive<D>
fn cat<const D: usize>( vectors: Vec<Self::Primitive<D>>, dim: usize ) -> Self::Primitive<D>
Concatenates the given tensors along the given dimension. Read more
source§fn equal<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> Tensor<B, D, Bool>
fn equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>
Equates the given tensors. Read more
source§fn elem_type_name() -> &'static str
fn elem_type_name() -> &'static str
Returns the name of the element type.
source§impl<B: Backend> Numeric<B> for Float
impl<B: Backend> Numeric<B> for Float
source§fn add<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> <Float as TensorKind<B>>::Primitive<D>
fn add<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> <Float as TensorKind<B>>::Primitive<D>
Adds two tensors together. Read more
source§fn add_scalar<const D: usize, E: ElementConversion>(
lhs: Self::Primitive<D>,
rhs: E
) -> Self::Primitive<D>
fn add_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>
Adds a scalar to a tensor element-wise. Read more
source§fn sub<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> <Float as TensorKind<B>>::Primitive<D>
fn sub<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> <Float as TensorKind<B>>::Primitive<D>
Subtracts two tensors. Read more
source§fn sub_scalar<const D: usize, E: ElementConversion>(
lhs: Self::Primitive<D>,
rhs: E
) -> Self::Primitive<D>
fn sub_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>
Subtracts a scalar from a tensor element-wise. Read more
source§fn div<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> <Float as TensorKind<B>>::Primitive<D>
fn div<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> <Float as TensorKind<B>>::Primitive<D>
Divides two tensors. Read more
source§fn div_scalar<const D: usize, E: ElementConversion>(
lhs: Self::Primitive<D>,
rhs: E
) -> Self::Primitive<D>
fn div_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>
Divides a tensor by a scalar element-wise. Read more
source§fn mul<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> <Float as TensorKind<B>>::Primitive<D>
fn mul<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> <Float as TensorKind<B>>::Primitive<D>
Multiplies two tensors. Read more
source§fn mul_scalar<const D: usize, E: ElementConversion>(
lhs: Self::Primitive<D>,
rhs: E
) -> Self::Primitive<D>
fn mul_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>
Multiplies a tensor by a scalar element-wise. Read more
source§fn neg<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<D>
fn neg<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<D>
Negates a tensor. Read more
source§fn zeros<const D: usize>(
shape: Shape<D>,
device: &B::Device
) -> Self::Primitive<D>
fn zeros<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>
Creates a tensor filled with zeros. Read more
source§fn ones<const D: usize>(
shape: Shape<D>,
device: &B::Device
) -> Self::Primitive<D>
fn ones<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>
Creates a tensor filled with ones. Read more
source§fn full<const D: usize, E: ElementConversion>(
shape: Shape<D>,
fill_value: E,
device: &B::Device
) -> Self::Primitive<D>
fn full<const D: usize, E: ElementConversion>( shape: Shape<D>, fill_value: E, device: &B::Device ) -> Self::Primitive<D>
Creates a tensor filled with elements equal to the given value. Read more
source§fn sum<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
fn sum<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
Sums all the elements of the tensor. Read more
source§fn sum_dim<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> Self::Primitive<D>
fn sum_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>
Sums all the elements of the tensor along a dimension. Read more
source§fn mean<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
fn mean<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
Computes the mean of all the elements of the tensor. Read more
source§fn mean_dim<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> Self::Primitive<D>
fn mean_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>
Computes the mean of all the elements of the tensor along a dimension. Read more
source§fn equal_elem<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Elem
) -> Tensor<B, D, Bool>
fn equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>
Element-wise equality between two tensors. Read more
source§fn greater<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> Tensor<B, D, Bool>
fn greater<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>
Element-wise greater than comparison between two tensors. Read more
source§fn greater_elem<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Elem
) -> Tensor<B, D, Bool>
fn greater_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>
Element-wise greater than comparison between a tensor and a scalar. Read more
source§fn greater_equal<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> Tensor<B, D, Bool>
fn greater_equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>
Element-wise greater than or equal comparison between two tensors. Read more
source§fn greater_equal_elem<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Elem
) -> Tensor<B, D, Bool>
fn greater_equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>
Element-wise greater than or equal comparison between a tensor and a scalar. Read more
source§fn lower<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> Tensor<B, D, Bool>
fn lower<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>
Element-wise less than comparison between two tensors. Read more
source§fn lower_elem<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Elem
) -> Tensor<B, D, Bool>
fn lower_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>
Element-wise less than comparison between a tensor and a scalar. Read more
source§fn lower_equal<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Primitive<D>
) -> Tensor<B, D, Bool>
fn lower_equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>
Element-wise less than or equal comparison between two tensors. Read more
source§fn lower_equal_elem<const D: usize>(
lhs: Self::Primitive<D>,
rhs: Self::Elem
) -> Tensor<B, D, Bool>
fn lower_equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>
Element-wise less than or equal comparison between a tensor and a scalar. Read more
source§fn mask_where<const D: usize>(
tensor: Self::Primitive<D>,
mask: Tensor<B, D, Bool>,
source: Self::Primitive<D>
) -> Self::Primitive<D>
fn mask_where<const D: usize>( tensor: Self::Primitive<D>, mask: Tensor<B, D, Bool>, source: Self::Primitive<D> ) -> Self::Primitive<D>
Selects elements from a tensor based on a boolean mask. Read more
source§fn mask_fill<const D: usize>(
tensor: Self::Primitive<D>,
mask: Tensor<B, D, Bool>,
value: Self::Elem
) -> Self::Primitive<D>
fn mask_fill<const D: usize>( tensor: Self::Primitive<D>, mask: Tensor<B, D, Bool>, value: Self::Elem ) -> Self::Primitive<D>
Fills elements of a tensor based on a boolean mask. Read more
source§fn select<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize,
indices: Tensor<B, 1, Int>
) -> Self::Primitive<D>
fn select<const D: usize>( tensor: Self::Primitive<D>, dim: usize, indices: Tensor<B, 1, Int> ) -> Self::Primitive<D>
Select tensor elements along the given dimension corresponding for the given indices. Read more
source§fn select_assign<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize,
indices: Tensor<B, 1, Int>,
values: Self::Primitive<D>
) -> Self::Primitive<D>
fn select_assign<const D: usize>( tensor: Self::Primitive<D>, dim: usize, indices: Tensor<B, 1, Int>, values: Self::Primitive<D> ) -> Self::Primitive<D>
Assign the selected elements along the given dimension corresponding to the given indices
from the value tensor. Read more
source§fn gather<const D: usize>(
dim: usize,
tensor: Self::Primitive<D>,
indices: Tensor<B, D, Int>
) -> Self::Primitive<D>
fn gather<const D: usize>( dim: usize, tensor: Self::Primitive<D>, indices: Tensor<B, D, Int> ) -> Self::Primitive<D>
Gathers elements from a tensor along an axis. Read more
source§fn scatter<const D: usize>(
dim: usize,
tensor: Self::Primitive<D>,
indices: Tensor<B, D, Int>,
values: Self::Primitive<D>
) -> Self::Primitive<D>
fn scatter<const D: usize>( dim: usize, tensor: Self::Primitive<D>, indices: Tensor<B, D, Int>, values: Self::Primitive<D> ) -> Self::Primitive<D>
Scatters elements into a tensor along an axis. Read more
source§fn argmax<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> <B as Backend>::IntTensorPrimitive<D>
fn argmax<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> <B as Backend>::IntTensorPrimitive<D>
Gets the indices of the maximum elements of a tensor along an axis. Read more
source§fn argmin<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> <B as Backend>::IntTensorPrimitive<D>
fn argmin<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> <B as Backend>::IntTensorPrimitive<D>
Gets the indices of the minimum elements of a tensor along an axis. Read more
source§fn max<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
fn max<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
Gets the maximum elements of a tensor along an axis. Read more
source§fn max_dim<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> Self::Primitive<D>
fn max_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>
Gets the maximum elements of a tensor along an axis. Read more
source§fn max_dim_with_indices<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> (Self::Primitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn max_dim_with_indices<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> (Self::Primitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Gets the maximum elements of a tensor along an axis. Read more
source§fn min<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
fn min<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>
Gets the minimum elements of a tensor along an axis. Read more
source§fn min_dim<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> Self::Primitive<D>
fn min_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>
Gets the minimum elements of a tensor along an axis. Read more
source§fn min_dim_with_indices<const D: usize>(
tensor: Self::Primitive<D>,
dim: usize
) -> (Self::Primitive<D>, <B as Backend>::IntTensorPrimitive<D>)
fn min_dim_with_indices<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> (Self::Primitive<D>, <B as Backend>::IntTensorPrimitive<D>)
Gets the minimum elements and indices of a tensor along an axis. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Float
impl Send for Float
impl Sync for Float
impl Unpin for Float
impl UnwindSafe for Float
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more