Struct burn::backend::autodiff::Autodiff

pub struct Autodiff<B, C = NoCheckpointing> { /* private fields */ }
Expand description

Enable auto-differentiation on a backend.

This works as a backend decorator, extending the functionality of any backend with backpropagation.

Trait Implementations§

§

impl<B, C> ActivationOps<Autodiff<B, C>> for Autodiff<B, C>

§

fn gelu( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Applies the Gelu activation function. Read more
§

fn relu( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Applies the ReLU activation function. Read more
§

fn sigmoid( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Applies the Sigmoid activation function. Read more
§

fn log_sigmoid( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Applies the LogSigmoid activation function. Read more
§

fn leaky_relu( tensor: <B as Backend>::FloatTensorPrimitive, negative_slope: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive

Applies the LeakyReLU activation function. Read more
§

fn relu_backward( output: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the ReLU activation function backward. Read more
§

fn prelu( tensor: <B as Backend>::FloatTensorPrimitive, alpha: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the PReLu activation function. Read more
§

fn gelu_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the Gelu activation function backward. Read more
§

fn sigmoid_backward( output: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the Sigmoid activation function backward. Read more
§

fn hard_sigmoid( tensor: <B as Backend>::FloatTensorPrimitive, alpha: <B as Backend>::FloatElem, beta: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive

Applies the hard Sigmoid activation function. Read more
§

fn log_sigmoid_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Applies the LogSigmoid activation function backward. Read more
§

impl<B, C> AutodiffBackend for Autodiff<B, C>

§

type InnerBackend = B

The inner backend type.
§

type Gradients = Gradients

Gradients type.
§

fn backward(tensor: AutodiffTensor<B>) -> Gradients

Backward pass. Read more
§

fn grad( tensor: &AutodiffTensor<B>, grads: &Gradients, ) -> Option<<B as Backend>::FloatTensorPrimitive>

Returns the gradients of a tensor. Read more
§

fn grad_remove( tensor: &AutodiffTensor<B>, grads: &mut Gradients, ) -> Option<<B as Backend>::FloatTensorPrimitive>

Pops the gradients of a tensor and returns them. Read more
§

fn inner(tensor: AutodiffTensor<B>) -> <B as Backend>::FloatTensorPrimitive

Returns the tensor with inner backend type. Read more
§

fn from_inner(tensor: <B as Backend>::FloatTensorPrimitive) -> AutodiffTensor<B>

Converts the inner backend tensor to the autodiff backend tensor. Read more
§

fn grad_replace( tensor: &AutodiffTensor<B>, grads: &mut <Autodiff<B, C> as AutodiffBackend>::Gradients, grad: <B as Backend>::FloatTensorPrimitive, )

Replace the gradients of a tensor with the one provided. Read more
§

fn int_inner( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, ) -> <<Autodiff<B, C> as AutodiffBackend>::InnerBackend as Backend>::IntTensorPrimitive

Returns the tensor with inner backend type. Read more
§

fn bool_inner( tensor: <Autodiff<B, C> as Backend>::BoolTensorPrimitive, ) -> <<Autodiff<B, C> as AutodiffBackend>::InnerBackend as Backend>::BoolTensorPrimitive

Returns the tensor with inner backend type. Read more
§

fn int_from_inner( tensor: <<Autodiff<B, C> as AutodiffBackend>::InnerBackend as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Converts the inner backend tensor to the autodiff backend tensor. Read more
§

fn bool_from_inner( tensor: <<Autodiff<B, C> as AutodiffBackend>::InnerBackend as Backend>::BoolTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::BoolTensorPrimitive

Converts the inner backend tensor to the autodiff backend tensor. Read more
§

fn q_inner( tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, ) -> <<Autodiff<B, C> as AutodiffBackend>::InnerBackend as Backend>::QuantizedTensorPrimitive

Returns the tensor with inner backend type. Read more
§

fn q_from_inner( tensor: <<Autodiff<B, C> as AutodiffBackend>::InnerBackend as Backend>::QuantizedTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Converts the inner backend tensor to the autodiff backend tensor. Read more
§

impl<B, C> Backend for Autodiff<B, C>

§

type Device = <B as Backend>::Device

Device type.
§

type FullPrecisionBridge = AutodiffBridge<<B as Backend>::FullPrecisionBridge>

A bridge that can cast tensors to full precision.
§

type FloatTensorPrimitive = AutodiffTensor<B>

Tensor primitive to be used for all float operations.
§

type FloatElem = <B as Backend>::FloatElem

Float element type.
§

type IntTensorPrimitive = <B as Backend>::IntTensorPrimitive

Tensor primitive to be used for all int operations.
§

type IntElem = <B as Backend>::IntElem

Int element type.
§

type BoolTensorPrimitive = <B as Backend>::BoolTensorPrimitive

Tensor primitive to be used for all bool operations.
§

type QuantizedTensorPrimitive = <B as Backend>::QuantizedTensorPrimitive

Tensor primitive to be used for all quantized operations.
§

type QuantizedEncoding = <B as Backend>::QuantizedEncoding

Quantized tensor encoding type.
§

fn ad_enabled() -> bool

If autodiff is enabled.
§

fn name() -> String

Name of the backend.
§

fn seed(seed: u64)

Seed the backend.
§

fn sync(device: &<B as Backend>::Device)

Sync the backend, ensure that all computation are finished.
§

impl<B, C, Bridge> BackendBridge<Autodiff<B, C>> for AutodiffBridge<Bridge>
where B: Backend, C: CheckpointStrategy, Bridge: BackendBridge<B> + 'static,

§

type Target = Autodiff<<Bridge as BackendBridge<B>>::Target, C>

The target backend
§

fn into_target( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, _device: Option<<<AutodiffBridge<Bridge> as BackendBridge<Autodiff<B, C>>>::Target as Backend>::Device>, ) -> <<AutodiffBridge<Bridge> as BackendBridge<Autodiff<B, C>>>::Target as Backend>::FloatTensorPrimitive

Transfer the tensor to the target backend.
§

fn from_target( tensor: <<AutodiffBridge<Bridge> as BackendBridge<Autodiff<B, C>>>::Target as Backend>::FloatTensorPrimitive, _device: Option<<Autodiff<B, C> as Backend>::Device>, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Transfer the tensor from the target backend.
§

impl<B, C> BoolTensorOps<Autodiff<B, C>> for Autodiff<B, C>

§

fn bool_from_data( data: TensorData, device: &<B as Backend>::Device, ) -> <B as Backend>::BoolTensorPrimitive

Creates a tensor from the data structure. Read more
§

fn bool_shape(tensor: &<B as Backend>::BoolTensorPrimitive) -> Shape

Returns the shape of the tensor. Read more
§

async fn bool_into_data( tensor: <B as Backend>::BoolTensorPrimitive, ) -> TensorData

Converts the tensor to a data structure. Read more
§

fn bool_into_int( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Converts bool tensor to int tensor. Read more
§

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_device( tensor: &<B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::Device

Gets the device of the tensor. Read more
§

fn bool_reshape( tensor: <B as Backend>::BoolTensorPrimitive, shape: Shape, ) -> <B as Backend>::BoolTensorPrimitive

Reshapes the tensor. Read more
§

fn bool_slice( tensor: <B as Backend>::BoolTensorPrimitive, ranges: &[Range<usize>], ) -> <B as Backend>::BoolTensorPrimitive

Gets the values from the tensor for the given ranges. Read more
§

fn bool_empty( shape: Shape, device: &<B as Backend>::Device, ) -> <B as Backend>::BoolTensorPrimitive

Creates a new bool tensor. Read more
§

fn bool_slice_assign( tensor: <Autodiff<B, C> as Backend>::BoolTensorPrimitive, ranges: &[Range<usize>], value: <Autodiff<B, C> as Backend>::BoolTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::BoolTensorPrimitive

Sets the values in the tensor for the given ranges. Read more
§

fn bool_cat( tensors: Vec<<B as Backend>::BoolTensorPrimitive>, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive

Concatenates the tensors along the given dimension. Read more
§

fn bool_equal( lhs: <B as Backend>::BoolTensorPrimitive, rhs: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Equates the two tensors. Read more
§

fn bool_not( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Inverses boolean values. Read more
§

fn bool_into_float( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <Autodiff<B> as Backend>::FloatTensorPrimitive

Converts bool tensor to float tensor. Read more
§

fn bool_swap_dims( tensor: <Autodiff<B> as Backend>::BoolTensorPrimitive, dim1: usize, dim2: usize, ) -> <Autodiff<B> as Backend>::BoolTensorPrimitive

Swaps two dimensions of a bool tensor. Read more
§

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. Read more
§

fn bool_chunk( tensor: <B as Backend>::BoolTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::BoolTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

fn bool_permute( tensor: <Autodiff<B, C> as Backend>::BoolTensorPrimitive, axes: &[usize], ) -> <Autodiff<B, C> as Backend>::BoolTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

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. Read more
§

async fn bool_argwhere( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Compute the indices of the elements that are non-zero, grouped by element. Read more
§

async fn bool_nonzero( tensor: <B as Backend>::BoolTensorPrimitive, ) -> Vec<<B as Backend>::IntTensorPrimitive>

Compute the indices of the elements that are non-zero. Read more
§

fn bool_expand( tensor: <B as Backend>::BoolTensorPrimitive, shape: Shape, ) -> <B as Backend>::BoolTensorPrimitive

Broadcasts the bool tensor to the given shape.
§

fn bool_repeat_dim( tensor: <B as Backend>::BoolTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::BoolTensorPrimitive

Repeats one dimension of the tensor a given number of times along that dimension. Read more
§

fn bool_not_equal( lhs: <B as Backend>::BoolTensorPrimitive, rhs: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise non-equality comparison. Read more
§

fn bool_transpose( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Transposes a bool tensor. Read more
§

fn bool_any( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if any element in the boolean tensor evaluates to True. Read more
§

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. Read more
§

fn bool_all( tensor: <B as Backend>::BoolTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if all elements in the boolean tensor evaluate to True. Read more
§

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. Read more
§

impl<B, C> Clone for Autodiff<B, C>
where B: Clone, C: Clone,

§

fn clone(&self) -> Autodiff<B, C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<B, C> Debug for Autodiff<B, C>
where B: Debug, C: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<B, C> Default for Autodiff<B, C>
where B: Default, C: Default,

§

fn default() -> Autodiff<B, C>

Returns the “default value” for a type. Read more
§

impl<B, C> FloatTensorOps<Autodiff<B, C>> for Autodiff<B, C>

§

fn float_from_data( data: TensorData, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Creates a new tensor from the data structure. Read more
§

fn float_random( shape: Shape, distribution: Distribution, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Creates a new tensor with random values. Read more
§

fn float_zeros( shape: Shape, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Creates a new tensor with zeros. Read more
§

fn float_ones( shape: Shape, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Creates a new tensor with ones. Read more
§

fn float_shape( tensor: &<Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> Shape

Gets the shape of the tensor. Read more
§

async fn float_into_data( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> TensorData

Converts the tensor to a data structure. Read more
§

fn float_device( tensor: &<Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::Device

Gets the device of the tensor. Read more
§

fn float_to_device( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Moves the tensor to the given device. Read more
§

fn float_empty( shape: Shape, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Creates an empty tensor with the given shape. Read more
§

fn float_add( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Adds two tensors together. Read more
§

fn float_add_scalar( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Adds a scalar to a tensor. Read more
§

fn float_sub( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Subtracts two tensors. Read more
§

fn float_sub_scalar( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Subtracts a scalar from a tensor. Read more
§

fn float_mul( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Multiplies two tensors together element-wise.
§

fn float_mul_scalar( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Multiplies a tensor by a scalar. Read more
§

fn float_div( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Divides two tensors element-wise. Read more
§

fn float_div_scalar( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Divides a tensor by a scalar. Read more
§

fn float_remainder_scalar( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Computes the modulus of a tensor given a scalar. Read more
§

fn float_matmul( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Multiplies two tensors together using matrix multiplication. Read more
§

fn float_neg( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Negates a tensor element-wise.
§

fn float_recip( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Calculates the reciprocals element-wise
§

fn float_swap_dims( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim1: usize, dim2: usize, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Swaps two dimensions of a tensor. Read more
§

fn float_permute( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, axes: &[usize], ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn float_flip( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, axes: &[usize], ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Reverse the order of elements in a tensor along the given axes. Read more
§

fn float_reshape( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, shape: Shape, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Reshapes a tensor. Read more
§

fn float_gather( dim: usize, tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Gather elements from a tensor. Read more
§

fn float_scatter( dim: usize, tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, value: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Scatter elements into a tensor. Read more
§

fn float_select( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Select tensor elements along the given dimension corresponding for the given indices. Read more
§

fn float_select_assign( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, value: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Assign the selected elements along the given dimension corresponding for the given indices to the given value. Read more
§

fn float_slice( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ranges: &[Range<usize>], ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Select tensor elements corresponding for the given ranges. Read more
§

fn float_slice_assign( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ranges: &[Range<usize>], value: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Assign the selected elements corresponding for the given ranges to the given value. Read more
§

fn float_mask_where( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, mask: <Autodiff<B, C> as Backend>::BoolTensorPrimitive, source: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Update the given tensor with the value tensor where the mask is true. Read more
§

fn float_mask_fill( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::FloatElem, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Update the given tensor with the value where the mask is true. Read more
§

fn float_equal( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Equal comparison of two tensors. Read more
§

fn float_equal_elem( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive

Equal comparison of a tensor and a scalar. Read more
§

fn float_greater( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Greater than comparison of two tensors. Read more
§

fn float_greater_elem( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive

Greater than comparison of a tensor and a scalar. Read more
§

fn float_greater_equal( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Greater than or equal comparison of two tensors. Read more
§

fn float_greater_equal_elem( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive

Greater than or equal comparison of a tensor and a scalar. Read more
§

fn float_lower( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Less than comparison of two tensors. Read more
§

fn float_lower_elem( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive

Less than comparison of a tensor and a scalar. Read more
§

fn float_lower_equal( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Less than or equal comparison of two tensors. Read more
§

fn float_lower_equal_elem( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive

Less than or equal comparison of a tensor and a scalar. Read more
§

fn float_detach( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Detaches a tensor from the computation graph.
§

fn float_set_require_grad( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, require_grad: bool, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Sets the require_grad flag of a tensor.
§

fn float_is_require_grad( tensor: &<Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> bool

Returns the require_grad flag of a tensor.
§

fn float_mean( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Mean of all elements in a tensor. Read more
§

fn float_sum( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Sum of all elements in a tensor. Read more
§

fn float_mean_dim( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Mean of all elements in a tensor along a dimension. Read more
§

fn float_sum_dim( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Sum of all elements in a tensor along a dimension. Read more
§

fn float_argmax( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the indices of the maximum elements of a tensor along an axis. Read more
§

fn float_argmin( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the indices of the minimum elements of a tensor along an axis. Read more
§

fn float_exp( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with exponential values. Read more
§

fn float_log( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with natural logarithm values. Read more
§

fn float_log1p( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with logarithm values of (1 + Xi). Read more
§

fn float_powf_scalar( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, value: f32, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with values raised to the power of float value. Read more
§

fn float_sqrt( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with square root values. Read more
§

fn float_abs( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with absolute values. Read more
§

fn float_cos( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with cosine values. Read more
§

fn float_sin( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with sine values. Read more
§

fn float_tanh( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with tangent values. Read more
§

fn float_round( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with rounded values. Read more
§

fn float_floor( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with floored values. Read more
§

fn float_ceil( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with ceiled values. Read more
§

fn float_erf( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns a new tensor with the error function values. Read more
§

fn float_cat( tensors: Vec<<Autodiff<B, C> as Backend>::FloatTensorPrimitive>, dim: usize, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Concatenates tensors along a dimension. Read more
§

fn float_max_dim( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Gets the maximum elements of a tensor along an axis. Read more
§

fn float_max_dim_with_indices( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> (<Autodiff<B, C> as Backend>::FloatTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the maximum elements of a tensor along an axis and their indices. Read more
§

fn float_min_dim( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Gets the minimum elements of a tensor along an axis. Read more
§

fn float_min_dim_with_indices( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, ) -> (<Autodiff<B, C> as Backend>::FloatTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the minimum elements of a tensor along an axis and their indices. Read more
§

fn float_into_int( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B> as Backend>::IntTensorPrimitive

Converts float tensor to int tensor. Read more
§

fn float_powf( lhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, rhs: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Element-wise power with a FloatTensor. Read more
§

fn float_sign( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Returns the signs of the float tensor. Read more
§

fn float_expand( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, shape: Shape, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Broadcasts the float tensor to the given shape.
§

fn float_sort( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, descending: bool, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Sort the elements of the input tensor by value in along a given dimension. Read more
§

fn float_sort_with_indices( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, descending: bool, ) -> (<Autodiff<B, C> as Backend>::FloatTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Sort the elements of the input tensor by value in along a given dimension. Read more
§

fn float_argsort( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, 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. Read more
§

fn float_repeat_dim( tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, dim: usize, times: usize, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Repeat the tensor along the given dimension. Read more
§

fn float_full( shape: Shape, fill_value: <B as Backend>::FloatElem, device: &<B as Backend>::Device, ) -> <B as Backend>::FloatTensorPrimitive

Creates a tensor filled with given value. Read more
§

fn float_clamp_min( tensor: <B as Backend>::FloatTensorPrimitive, min: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive

Clamps a tensor under a minimum value. Read more
§

fn float_clamp_max( tensor: <B as Backend>::FloatTensorPrimitive, max: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive

Clamps a tensor over a maximum value. Read more
§

fn float_clamp( tensor: <B as Backend>::FloatTensorPrimitive, min: <B as Backend>::FloatElem, max: <B as Backend>::FloatElem, ) -> <B as Backend>::FloatTensorPrimitive

Clamps a tensor between a minimum and maximum value. Read more
§

fn float_transpose( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Transposes a tensor. Read more
§

fn float_not_equal( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise non-equality comparison. Read more
§

fn float_not_equal_elem( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise non-equality comparison with a scalar. Read more
§

fn float_prod( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Product of all elements in a tensor. Read more
§

fn float_prod_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::FloatTensorPrimitive

Product of all elements in a tensor along a dimension. Read more
§

fn float_into_full_precision( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive

Converts a tensor to full precision. Read more
§

fn float_from_full_precision( tensor: <<<B as Backend>::FullPrecisionBridge as BackendBridge<B>>::Target as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Converts a tensor from full precision. Read more
§

fn float_powi( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Element-wise power with an IntTensor. Read more
§

fn float_powi_scalar( lhs: <B as Backend>::FloatTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::FloatTensorPrimitive

raises a tensor to the power of an int scalar. Read more
§

fn float_max( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Gets the maximum element of a tensor. Read more
§

fn float_min( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Gets the minimum element of a tensor. Read more
§

fn float_narrow( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::FloatTensorPrimitive

Returns a new tensor with the given dimension narrowed to the given range. Read more
§

fn float_chunk( tensor: <B as Backend>::FloatTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::FloatTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

fn float_any( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if any element in the float tensor evaluates to True. Read more
§

fn float_any_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive

Tests if any element in the float tensor evaluates to True along a given dimension dim. Read more
§

fn float_all( tensor: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if all elements in the float tensor evaluate to True. Read more
§

fn float_all_dim( tensor: <B as Backend>::FloatTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive

Tests if all elements in the float tensor evaluate to True along a given dimension dim. Read more
§

impl<B, C> IntTensorOps<Autodiff<B, C>> for Autodiff<B, C>

§

fn int_from_data( data: TensorData, device: &<Autodiff<B, C> as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Creates a tensor from the data structure. Read more
§

fn int_shape(tensor: &<B as Backend>::IntTensorPrimitive) -> Shape

Returns the shape of the tensor. Read more
§

async fn int_into_data(tensor: <B as Backend>::IntTensorPrimitive) -> TensorData

Converts the tensor to a data structure. Read more
§

fn int_to_device( tensor: <B as Backend>::IntTensorPrimitive, device: &<Autodiff<B, C> as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Moves the tensor to the given device.
§

fn int_device( tensor: &<B as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::Device

Gets the device of the tensor. Read more
§

fn int_reshape( tensor: <B as Backend>::IntTensorPrimitive, shape: Shape, ) -> <B as Backend>::IntTensorPrimitive

Reshapes the tensor. Read more
§

fn int_slice( tensor: <B as Backend>::IntTensorPrimitive, ranges: &[Range<usize>], ) -> <B as Backend>::IntTensorPrimitive

Gets the element at the given indices. Read more
§

fn int_empty( shape: Shape, device: &<Autodiff<B> as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Creates a new int tensor. Read more
§

fn int_slice_assign( tensor: <B as Backend>::IntTensorPrimitive, ranges: &[Range<usize>], value: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Sets the element at the given indices. Read more
§

fn int_cat( tensors: Vec<<B as Backend>::IntTensorPrimitive>, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Concatenates the given tensors along the given dimension. Read more
§

fn int_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise equality comparison. Read more
§

fn int_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise equality comparison with a scalar. Read more
§

fn int_add( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Element-wise addition. Read more
§

fn int_add_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Element-wise addition with a scalar. Read more
§

fn int_clamp_min( tensor: <B as Backend>::IntTensorPrimitive, min: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Clamps a tensor under a minimum value. Read more
§

fn int_clamp_max( tensor: <B as Backend>::IntTensorPrimitive, max: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Clamps a tensor over a maximum value. Read more
§

fn int_clamp( tensor: <B as Backend>::IntTensorPrimitive, min: <B as Backend>::IntElem, max: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Clamps a tensor between a minimum and maximum value. Read more
§

fn int_sub( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Element-wise subtraction. Read more
§

fn int_sub_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Element-wise subtraction with a scalar. Read more
§

fn int_mul( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Element-wise multiplication. Read more
§

fn int_mul_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Element-wise multiplication with a scalar. Read more
§

fn int_div( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Element-wise division. Read more
§

fn int_div_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Element-wise division with a scalar. Read more
§

fn int_remainder_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Element-wise modulus with a scalar. Read more
§

fn int_neg( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Element-wise negation. Read more
§

fn int_zeros( shape: Shape, device: &<Autodiff<B, C> as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Creates a tensor of zeros. Read more
§

fn int_ones( shape: Shape, device: &<Autodiff<B, C> as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Creates a tensor of ones. Read more
§

fn int_full( shape: Shape, fill_value: <B as Backend>::IntElem, device: &<Autodiff<B, C> as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Creates a tensor filled with given value. Read more
§

fn int_sum( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Sums all elements in the tensor. Read more
§

fn int_sum_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Sums all elements in the tensor along a dimension. Read more
§

fn int_mean( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Computes the mean of all elements in the tensor. Read more
§

fn int_mean_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Computes the mean of all elements in the tensor along a dimension. Read more
§

fn int_repeat_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::IntTensorPrimitive

Repeats the tensor along the given dimension the given number of times. Read more
§

fn int_greater( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise greater than comparison. Read more
§

fn int_greater_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise greater than comparison with a scalar. Read more
§

fn int_greater_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise greater than or equal comparison. Read more
§

fn int_greater_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise greater than or equal comparison with a scalar. Read more
§

fn int_lower( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise less than comparison. Read more
§

fn int_lower_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise less than comparison with a scalar. Read more
§

fn int_lower_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise less than or equal comparison. Read more
§

fn int_lower_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise less than or equal comparison with a scalar. Read more
§

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. Read more
§

fn int_scatter( dim: usize, tensor: <B as Backend>::IntTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, value: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Scatter a given value to the tensor at the given indices. Read more
§

fn int_select( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Select tensor elements along the given dimension corresponding to the given indices. Read more
§

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

Assign the selected elements along the given dimension corresponding to the given indices to the given value. Read more
§

fn int_mask_where( tensor: <B as Backend>::IntTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::IntTensorPrimitive, ) -> <Autodiff<B> as Backend>::IntTensorPrimitive

Fills the tensor with values from the source tensor if the mask is true at the given indices. Read more
§

fn int_mask_fill( tensor: <B as Backend>::IntTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::IntElem, ) -> <Autodiff<B> as Backend>::IntTensorPrimitive

Fills the tensor with the given value if the mask is true at the given indices. Read more
§

fn int_argmax( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the indices of the maximum elements along a dimension. Read more
§

fn int_argmin( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the indices of the minimum elements along a dimension. Read more
§

fn int_max( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Gets the maximum element in the tensor. Read more
§

fn int_max_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the maximum element in the tensor along a dimension. Read more
§

fn int_max_dim_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the maximum elements and corresponding indices along a dimension. Read more
§

fn int_min( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Gets the minimum element in the tensor. Read more
§

fn int_min_dim( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> <B as Backend>::IntTensorPrimitive

Gets the minimum elements in the tensor along a dimension. Read more
§

fn int_min_dim_with_indices( tensor: <B as Backend>::IntTensorPrimitive, dim: usize, ) -> (<B as Backend>::IntTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the minimum elements and corresponding indices along a dimension. Read more
§

fn int_abs( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Returns a new tensor with absolute values. Read more
§

fn int_into_float( tensor: <Autodiff<B> as Backend>::IntTensorPrimitive, ) -> <Autodiff<B> as Backend>::FloatTensorPrimitive

Converts int tensor to float tensor. Read more
§

fn int_swap_dims( tensor: <Autodiff<B> as Backend>::IntTensorPrimitive, dim1: usize, dim2: usize, ) -> <Autodiff<B> as Backend>::IntTensorPrimitive

Swaps two dimensions of an int tensor. Read more
§

fn int_narrow( tensor: <Autodiff<B> as Backend>::IntTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <Autodiff<B> as Backend>::IntTensorPrimitive

Returns a new tensor with the given dimension narrowed to the given range. Read more
§

fn int_chunk( tensor: <Autodiff<B> as Backend>::IntTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<Autodiff<B> as Backend>::IntTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

fn int_random( shape: Shape, distribution: Distribution, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Creates a new int tensor with random values. Read more
§

fn int_arange( range: Range<i64>, device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Creates a new tensor with values from the given range. Read more
§

fn int_permute( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, axes: &[usize], ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn int_flip( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, axes: &[usize], ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Reverse the order of elements in a tensor along the given axes. Read more
§

fn int_sign( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Returns the signs of the int tensor. Read more
§

fn int_prod( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Computes the product of all elements in the tensor. Read more
§

fn int_prod_dim( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, dim: usize, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Computes the product of all elements in the tensor along a dimension. Read more
§

fn int_expand( tensor: <B as Backend>::IntTensorPrimitive, shape: Shape, ) -> <B as Backend>::IntTensorPrimitive

Broadcasts the int tensor to the given shape.
§

fn int_sort( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Sort the elements of the input tensor by value along a given dimension. Read more
§

fn int_sort_with_indices( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> (<Autodiff<B, C> as Backend>::IntTensorPrimitive, <Autodiff<B, C> as Backend>::IntTensorPrimitive)

Sort the elements of the input tensor by value along a given dimension. Read more
§

fn int_argsort( tensor: <Autodiff<B, C> as Backend>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Returns the indices that sort the elements of the input tensor by value along a given dimension. Read more
§

fn int_not_equal( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise non-equality comparison. Read more
§

fn int_not_equal_elem( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::BoolTensorPrimitive

Element-wise non-equality comparison with a scalar. Read more
§

fn int_powi( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Element-wise power with a IntTensor. Read more
§

fn int_powf( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Element-wise power with a floatTensor. Read more
§

fn int_powi_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::IntTensorPrimitive

Element-wise power with a scalar. Read more
§

fn int_powf_scalar( lhs: <B as Backend>::IntTensorPrimitive, rhs: f32, ) -> <B as Backend>::IntTensorPrimitive

Element-wise power with a floatTensor. Read more
§

fn int_transpose( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::IntTensorPrimitive

Transposes an int tensor. Read more
§

fn int_arange_step( range: Range<i64>, step: usize, device: &<B as Backend>::Device, ) -> <B as Backend>::IntTensorPrimitive

Creates a new tensor with values from the given range with the given step size. Read more
§

fn int_any( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if any element in the int tensor evaluates to True. Read more
§

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. Read more
§

fn int_all( tensor: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if all elements in the int tensor evaluate to True. Read more
§

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. Read more
§

impl<B, C> ModuleOps<Autodiff<B, C>> for Autodiff<B, C>

§

fn embedding( weights: AutodiffTensor<B>, indices: <B as Backend>::IntTensorPrimitive, ) -> AutodiffTensor<B>

Embedding operation. Read more
§

fn embedding_backward( _weights: AutodiffTensor<B>, _output: AutodiffTensor<B>, _indices: <B as Backend>::IntTensorPrimitive, ) -> AutodiffTensor<B>

Embedding backward operation. Read more
§

fn conv1d( x: AutodiffTensor<B>, weight: AutodiffTensor<B>, bias: Option<AutodiffTensor<B>>, options: ConvOptions<1>, ) -> AutodiffTensor<B>

One dimensional convolution. Read more
§

fn conv_transpose1d( x: AutodiffTensor<B>, weight: AutodiffTensor<B>, bias: Option<AutodiffTensor<B>>, options: ConvTransposeOptions<1>, ) -> AutodiffTensor<B>

One dimensional transposed convolution. Read more
§

fn conv2d( x: AutodiffTensor<B>, weight: AutodiffTensor<B>, bias: Option<AutodiffTensor<B>>, options: ConvOptions<2>, ) -> AutodiffTensor<B>

Two dimensional convolution. Read more
§

fn deform_conv2d( x: AutodiffTensor<B>, offset: AutodiffTensor<B>, weight: AutodiffTensor<B>, mask: Option<AutodiffTensor<B>>, bias: Option<AutodiffTensor<B>>, options: DeformConvOptions<2>, ) -> AutodiffTensor<B>

Two dimensional deformable convolution. Read more
§

fn deform_conv2d_backward( _x: AutodiffTensor<B>, _offset: AutodiffTensor<B>, _weight: AutodiffTensor<B>, _mask: Option<AutodiffTensor<B>>, _bias: Option<AutodiffTensor<B>>, _output_grad: AutodiffTensor<B>, _options: DeformConvOptions<2>, ) -> DeformConv2dBackward<Autodiff<B, C>>

Backward pass for the deform_conv2d operation.
§

fn conv_transpose2d( x: AutodiffTensor<B>, weight: AutodiffTensor<B>, bias: Option<AutodiffTensor<B>>, options: ConvTransposeOptions<2>, ) -> AutodiffTensor<B>

Two dimensional transposed convolution. Read more
§

fn conv3d( x: AutodiffTensor<B>, weight: AutodiffTensor<B>, bias: Option<AutodiffTensor<B>>, options: ConvOptions<3>, ) -> AutodiffTensor<B>

Three dimensional convolution. Read more
§

fn conv_transpose3d( x: AutodiffTensor<B>, weight: AutodiffTensor<B>, bias: Option<AutodiffTensor<B>>, options: ConvTransposeOptions<3>, ) -> AutodiffTensor<B>

Three dimensional transposed convolution. Read more
§

fn avg_pool1d( x: AutodiffTensor<B>, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> AutodiffTensor<B>

One dimensional avg pooling. Read more
§

fn avg_pool2d( x: AutodiffTensor<B>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> AutodiffTensor<B>

Two dimensional avg pooling. Read more
§

fn avg_pool2d_backward( _x: AutodiffTensor<B>, _grad: AutodiffTensor<B>, _kernel_size: [usize; 2], _stride: [usize; 2], _padding: [usize; 2], _count_include_pad: bool, ) -> AutodiffTensor<B>

Backward pass for the avg pooling 2d operation.
§

fn max_pool1d( x: AutodiffTensor<B>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> AutodiffTensor<B>

One dimensional max pooling. Read more
§

fn max_pool1d_with_indices( x: AutodiffTensor<B>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> MaxPool1dWithIndices<Autodiff<B, C>>

One dimensional max pooling with indices. Read more
§

fn max_pool1d_with_indices_backward( x: AutodiffTensor<B>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, output_grad: AutodiffTensor<B>, indices: <B as Backend>::IntTensorPrimitive, ) -> MaxPool1dBackward<Autodiff<B, C>>

Backward pass for the max pooling 1d operation.
§

fn max_pool2d( x: AutodiffTensor<B>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> AutodiffTensor<B>

Two dimensional max pooling. Read more
§

fn max_pool2d_with_indices( x: AutodiffTensor<B>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> MaxPool2dWithIndices<Autodiff<B, C>>

Two dimensional max pooling with indices. Read more
§

fn max_pool2d_with_indices_backward( _x: AutodiffTensor<B>, _kernel_size: [usize; 2], _stride: [usize; 2], _padding: [usize; 2], _dilation: [usize; 2], _output_grad: AutodiffTensor<B>, _indices: <B as Backend>::IntTensorPrimitive, ) -> MaxPool2dBackward<Autodiff<B, C>>

Backward pass for the max pooling 2d operation.
§

fn adaptive_avg_pool1d( x: AutodiffTensor<B>, output_size: usize, ) -> AutodiffTensor<B>

One dimensional adaptive avg pooling. Read more
§

fn adaptive_avg_pool2d( x: AutodiffTensor<B>, output_size: [usize; 2], ) -> AutodiffTensor<B>

Two dimensional adaptive avg pooling. Read more
§

fn adaptive_avg_pool2d_backward( _x: AutodiffTensor<B>, _grad: AutodiffTensor<B>, ) -> <Autodiff<B> as Backend>::FloatTensorPrimitive

Backward pass for the adaptive avg pooling 2d operation.
§

fn interpolate( x: AutodiffTensor<B>, output_size: [usize; 2], options: InterpolateOptions, ) -> AutodiffTensor<B>

Down/up samples the input. Read more
§

fn interpolate_backward( _x: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, _grad: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, _output_size: [usize; 2], _options: InterpolateOptions, ) -> <Autodiff<B> as Backend>::FloatTensorPrimitive

Backward pass for the interpolate operation.
§

fn conv1d_x_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv1d operation, returning the gradient for x.
§

fn conv1d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv1d operation, returning the gradient for weight.
§

fn conv1d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv1d operation, returning the gradient for bias.
§

fn conv2d_x_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv2d operation, returning the gradient for x.
§

fn conv2d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv2d operation, returning the gradient for weight.
§

fn conv2d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv2d operation, returning the gradient for bias.
§

fn conv3d_x_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv3d operation, returning the gradient for x.
§

fn conv3d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv3d operation, returning the gradient for weight.
§

fn conv3d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv3d operation, returning the gradient for bias.
§

fn conv_transpose1d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 1d operation, returning the gradient for x.
§

fn conv_transpose1d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 1d operation, returning the gradient for weight.
§

fn conv_transpose1d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 1d operation, returning the gradient for bias.
§

fn conv_transpose2d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 2d operation, returning the gradient for x.
§

fn conv_transpose2d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 2d operation, returning the gradient for weight.
§

fn conv_transpose2d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 2d operation, returning the gradient for bias.
§

fn conv_transpose3d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 3d operation, returning the gradient for x.
§

fn conv_transpose3d_weight_backward( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 3d operation, returning the gradient for weight.
§

fn conv_transpose3d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the conv transpose 3d operation, returning the gradient for bias.
§

fn unfold4d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], options: UnfoldOptions, ) -> <B as Backend>::FloatTensorPrimitive

Four-dimensional unfolding. Read more
§

fn avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the avg pooling 1d operation.
§

fn adaptive_avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Backward pass for the adaptive avg pooling 1d operation.
§

impl<B, C> QTensorOps<Autodiff<B, C>> for Autodiff<B, C>

§

fn q_from_data( _data: TensorData, _device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Creates a new tensor from the data structure. Read more
§

fn quantize( _tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, _scheme: &QuantizationScheme, _qparams: QuantizationParametersPrimitive<Autodiff<B, C>>, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Convert the tensor to a lower precision data type based on the quantization scheme and parameters.
§

fn quantize_dynamic( _tensor: <Autodiff<B, C> as Backend>::FloatTensorPrimitive, _scheme: &QuantizationScheme, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Dynamically convert the tensor to a lower precision data type based on the quantization scheme.
§

fn dequantize( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::FloatTensorPrimitive

Convert the tensor back to a higher precision data type.
§

fn q_shape( tensor: &<Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, ) -> Shape

Gets the shape of the tensor. Read more
§

fn q_device( tensor: &<Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::Device

Gets the device of the tensor. Read more
§

fn q_to_device( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _device: &<Autodiff<B, C> as Backend>::Device, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Moves the tensor to the given device. Read more
§

fn q_reshape( tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, shape: Shape, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Reshapes a tensor. Read more
§

async fn q_into_data( tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, ) -> TensorData

Converts the tensor to a data structure. Read more
§

fn q_swap_dims( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _dim1: usize, _dim2: usize, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Swaps two dimensions of a tensor. Read more
§

fn q_permute( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _axes: &[usize], ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn q_flip( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _axes: &[usize], ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Reverse the order of elements in a tensor along the given axes. Read more
§

fn q_gather( _dim: usize, _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _indices: <Autodiff<B, C> as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Gather elements from a tensor. Read more
§

fn q_select( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _dim: usize, _indices: <Autodiff<B, C> as Backend>::IntTensorPrimitive, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Select tensor elements along the given dimension corresponding for the given indices. Read more
§

fn q_slice( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _ranges: &[Range<usize>], ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Select tensor elements corresponding for the given ranges. Read more
§

fn q_argmax( tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Gets the indices of the maximum elements of a tensor along an axis. Read more
§

fn q_argmin( tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <Autodiff<B, C> as Backend>::IntTensorPrimitive

Gets the indices of the minimum elements of a tensor along an axis. Read more
§

fn q_expand( _tensor: <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive, _shape: Shape, ) -> <Autodiff<B, C> as Backend>::QuantizedTensorPrimitive

Broadcasts the tensor to the given shape.
§

fn q_detach( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Detaches a tensor from the computation graph.
§

fn q_set_require_grad( tensor: <B as Backend>::QuantizedTensorPrimitive, _require_grad: bool, ) -> <B as Backend>::QuantizedTensorPrimitive

Sets the require_grad flag of a tensor.
§

fn q_is_require_grad(_tensor: &<B as Backend>::QuantizedTensorPrimitive) -> bool

Returns the require_grad flag of a tensor.
§

fn q_repeat_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, times: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Repeat the tensor along the given dimension. Read more
§

fn q_add( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Adds two tensors together. Read more
§

fn q_add_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Adds a scalar to a tensor. Read more
§

fn q_clamp_min( tensor: <B as Backend>::QuantizedTensorPrimitive, min: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Clamps a tensor under a minimum value. Read more
§

fn q_clamp_max( tensor: <B as Backend>::QuantizedTensorPrimitive, max: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Clamps a tensor over a maximum value. Read more
§

fn q_clamp( tensor: <B as Backend>::QuantizedTensorPrimitive, min: <B as Backend>::FloatElem, max: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Clamps a tensor between a minimum and maximum value. Read more
§

fn q_sub( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Subtracts two tensors. Read more
§

fn q_sub_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Subtracts a scalar from a tensor. Read more
§

fn q_mul( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Multiplies two tensors together element-wise.
§

fn q_mul_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Multiplies a tensor by a scalar. Read more
§

fn q_div( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Divides two tensors element-wise. Read more
§

fn q_div_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Divides a tensor by a scalar. Read more
§

fn q_remainder_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Computes the modulus of a tensor given a scalar. Read more
§

fn q_matmul( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Multiplies two tensors together using matrix multiplication. Read more
§

fn q_neg( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Negates a tensor element-wise.
§

fn q_recip( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Calculates the reciprocals element-wise
§

fn q_transpose( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Transposes a tensor. Read more
§

fn q_scatter( dim: usize, tensor: <B as Backend>::QuantizedTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Scatter elements into a tensor. Read more
§

fn q_select_assign( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, indices: <B as Backend>::IntTensorPrimitive, value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Assign the selected elements along the given dimension corresponding for the given indices to the given value. Read more
§

fn q_slice_assign( tensor: <B as Backend>::QuantizedTensorPrimitive, ranges: &[Range<usize>], value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Assign the selected elements corresponding for the given ranges to the given value. Read more
§

fn q_mask_where( tensor: <B as Backend>::QuantizedTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Update the given tensor with the value tensor where the mask is true. Read more
§

fn q_mask_fill( tensor: <B as Backend>::QuantizedTensorPrimitive, mask: <B as Backend>::BoolTensorPrimitive, value: <B as Backend>::FloatElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Update the given tensor with the value where the mask is true. Read more
§

fn q_sum( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Sum of all elements in a tensor. Read more
§

fn q_sum_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Sum of all elements in a tensor along a dimension. Read more
§

fn q_prod( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Product of all elements in a tensor. Read more
§

fn q_prod_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Product of all elements in a tensor along a dimension. Read more
§

fn q_mean( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Mean of all elements in a tensor. Read more
§

fn q_mean_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Mean of all elements in a tensor along a dimension. Read more
§

fn q_exp( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with exponential values. Read more
§

fn q_log( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with natural logarithm values. Read more
§

fn q_log1p( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with logarithm values of (1 + Xi). Read more
§

fn q_powf( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Element-wise power with another tensor. Read more
§

fn q_powi( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Element-wise power with an IntTensor. Read more
§

fn q_powi_scalar( lhs: <B as Backend>::QuantizedTensorPrimitive, rhs: <B as Backend>::IntElem, ) -> <B as Backend>::QuantizedTensorPrimitive

Element-wise power with an int scalar. Read more
§

fn q_powf_scalar( tensor: <B as Backend>::QuantizedTensorPrimitive, value: f32, ) -> <B as Backend>::QuantizedTensorPrimitive

Element-wise power with a float scalar. Read more
§

fn q_sqrt( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with square root values. Read more
§

fn q_abs( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with absolute values. Read more
§

fn q_cos( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with cosine values. Read more
§

fn q_sin( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with sine values. Read more
§

fn q_tanh( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with tangent values. Read more
§

fn q_erf( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with the error function values. Read more
§

fn q_cat( tensors: Vec<<B as Backend>::QuantizedTensorPrimitive>, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Concatenates tensors along a dimension. Read more
§

fn q_max( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the maximum element of a tensor. Read more
§

fn q_max_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the maximum elements of a tensor along an axis. Read more
§

fn q_max_dim_with_indices( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> (<B as Backend>::QuantizedTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the maximum elements of a tensor along an axis and their indices. Read more
§

fn q_min( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the minimum element of a tensor. Read more
§

fn q_min_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Gets the minimum elements of a tensor along an axis. Read more
§

fn q_min_dim_with_indices( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> (<B as Backend>::QuantizedTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Gets the minimum elements of a tensor along an axis and their indices. Read more
§

fn q_narrow( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, start: usize, length: usize, ) -> <B as Backend>::QuantizedTensorPrimitive

Returns a new tensor with the given dimension narrowed to the given range. Read more
§

fn q_chunk( tensor: <B as Backend>::QuantizedTensorPrimitive, chunks: usize, dim: usize, ) -> Vec<<B as Backend>::QuantizedTensorPrimitive>

Split the tensor along the given dimension into chunks. Read more
§

fn q_any( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if any element in the tensor evaluates to True. Read more
§

fn q_any_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive

Tests if any element in the float tensor evaluates to True along a given dimension dim. Read more
§

fn q_all( tensor: <B as Backend>::QuantizedTensorPrimitive, ) -> <B as Backend>::BoolTensorPrimitive

Tests if all elements in the tensor evaluate to True. Read more
§

fn q_all_dim( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, ) -> <B as Backend>::BoolTensorPrimitive

Tests if all elements in the tensor evaluate to True along a given dimension dim. Read more
§

fn q_sort( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> <B as Backend>::QuantizedTensorPrimitive

Sort the elements of the input tensor by value in along a given dimension. Read more
§

fn q_sort_with_indices( tensor: <B as Backend>::QuantizedTensorPrimitive, dim: usize, descending: bool, ) -> (<B as Backend>::QuantizedTensorPrimitive, <B as Backend>::IntTensorPrimitive)

Sort the elements of the input tensor by value in along a given dimension. Read more
§

fn q_argsort( tensor: <B as Backend>::QuantizedTensorPrimitive, 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. Read more
§

impl<B, C> Copy for Autodiff<B, C>
where B: Copy, C: Copy,

Auto Trait Implementations§

§

impl<B, C> Freeze for Autodiff<B, C>

§

impl<B, C> RefUnwindSafe for Autodiff<B, C>

§

impl<B, C> Send for Autodiff<B, C>
where B: Send, C: Send,

§

impl<B, C> Sync for Autodiff<B, C>
where B: Sync, C: Sync,

§

impl<B, C> Unpin for Autodiff<B, C>
where B: Unpin, C: Unpin,

§

impl<B, C> UnwindSafe for Autodiff<B, C>
where B: UnwindSafe, C: UnwindSafe,

Blanket Implementations§

§

impl<T> Adaptor<()> for T

§

fn adapt(&self)

Adapt the type to be passed to a metric.
source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,