Skip to main content

Dispatch

Struct Dispatch 

Source
pub struct Dispatch;

Trait Implementations§

Source§

impl ActivationOps<Dispatch> for Dispatch

Source§

fn silu(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Applies SiLU element-wise. Backends may fuse its arithmetic and rounding.
Source§

fn leaky_relu( tensor: FloatTensor<Self>, negative_slope: Scalar, ) -> FloatTensor<Self>

Applies the LeakyReLU activation function. Read more
Source§

fn relu(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Applies the ReLU activation function. Read more
Source§

fn relu_backward( output: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Applies the ReLU activation function backward. Read more
Source§

fn gelu(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Applies the Gelu activation function. Read more
Source§

fn prelu( tensor: FloatTensor<Self>, alpha: FloatTensor<Self>, ) -> FloatTensor<Self>

Applies the PReLu activation function. Read more
Source§

fn gelu_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Applies the Gelu activation function backward. Read more
Source§

fn sigmoid(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Applies the Sigmoid activation function. Read more
Source§

fn sigmoid_backward( output: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Applies the Sigmoid activation function backward. Read more
Source§

fn hard_sigmoid( tensor: FloatTensor<Self>, alpha: Scalar, beta: Scalar, ) -> FloatTensor<Self>

Applies the hard Sigmoid activation function. Read more
Source§

fn log_sigmoid(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Applies the LogSigmoid activation function. Read more
Source§

fn softmax(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

Applies the softmax function along the given dimension. Read more
Source§

fn log_softmax(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

Applies the log-softmax function along the given dimension. Read more
Source§

fn softmin(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

Applies the softmin function along the given dimension. Read more
Source§

fn log_sigmoid_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Applies the LogSigmoid activation function backward. Read more
Source§

impl AutodiffBackend for Dispatch

Source§

type InnerBackend = Dispatch

The inner backend type.
Source§

type Gradients = Gradients

Gradients type.
Source§

fn backward(tensor: DispatchTensor) -> Self::Gradients

Backward pass. Read more
Source§

fn grad( tensor: &DispatchTensor, grads: &Self::Gradients, ) -> Option<DispatchTensor>

Returns the gradients of a tensor. Read more
Source§

fn grad_remove( tensor: &DispatchTensor, grads: &mut Self::Gradients, ) -> Option<DispatchTensor>

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

fn q_grad( tensor: &DispatchTensor, grads: &Self::Gradients, ) -> Option<DispatchTensor>

Query gradients retained by a differentiable quantized tensor’s surrogate.
Source§

fn q_grad_remove( tensor: &DispatchTensor, grads: &mut Self::Gradients, ) -> Option<DispatchTensor>

Remove gradients retained by a differentiable quantized tensor’s surrogate.
Source§

fn grad_replace( tensor: &DispatchTensor, grads: &mut Self::Gradients, grad: DispatchTensor, )

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

fn q_grad_replace( tensor: &DispatchTensor, grads: &mut Self::Gradients, grad: DispatchTensor, )

Replace a quantized surrogate’s retained gradients without modifying its storage.
Source§

fn inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
Source§

fn from_inner(tensor: DispatchTensor) -> DispatchTensor

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

fn int_inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
Source§

fn int_from_inner(tensor: DispatchTensor) -> DispatchTensor

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

fn bool_inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
Source§

fn bool_from_inner(tensor: DispatchTensor) -> DispatchTensor

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

fn q_inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
Source§

fn q_from_inner(tensor: DispatchTensor) -> DispatchTensor

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

impl Backend for Dispatch

Source§

fn ad_enabled(device: &DispatchDevice) -> bool

If autodiff is enabled.
Source§

fn autodiff_creation_context(device: &DispatchDevice) -> AutodiffContext

Runtime association for new tensors on this device in the current synchronous scope.
Source§

fn with_autodiff_creation_context<R>( device: &DispatchDevice, context: AutodiffContext, func: impl FnOnce() -> R, ) -> R

Run synchronous tensor creation with an explicit association, restoring it on unwind.
Source§

fn name(device: &DispatchDevice) -> String

Name of the backend.
Source§

fn seed(device: &DispatchDevice, seed: u64)

Seeds the backend on the specified device. Read more
Source§

fn rng_state(device: &DispatchDevice) -> Result<Vec<u8>, ExecutionError>

Source§

fn restore_rng_state( device: &DispatchDevice, state: &[u8], ) -> Result<(), ExecutionError>

Source§

fn sync(device: &DispatchDevice) -> Result<(), ExecutionError>

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

fn flush(device: &DispatchDevice) -> Result<(), ExecutionError>

Submit the current stream’s buffered work without waiting for device completion. Eager backends may return immediately; deferred backends must dispatch their queue.
Source§

fn memory_cleanup(device: &DispatchDevice)

Manually triggers a memory cleanup on the given device.
Source§

fn memory_persistent_allocations<Output: Send, Input: Send, Func: Fn(Input) -> Output + Send>( device: &DispatchDevice, input: Input, func: Func, ) -> Output

Sets the current allocation mode to persistent.
Source§

fn profile<O: Send + 'static>( device: &DispatchDevice, options: ProfileOptions, func: impl FnOnce() -> O + Send, ) -> Result<(O, ProfileDuration), ExecutionError>

Measure a closure, preserving the timing method reported by this backend.
Source§

fn profile_start( device: &DispatchDevice, ) -> Result<Option<ProfileToken>, ExecutionError>

Open an independent profiling window, or return None for system-only timing.
Source§

fn profile_end( device: &DispatchDevice, token: ProfileToken, options: ProfileOptions, ) -> Result<ProfileDuration, ExecutionError>

Close a window on the stream where it opened, optionally flushing deferred work.
Source§

fn profile_abandon(device: &DispatchDevice, token: ProfileToken)

Release an abandoned window, including when a profiled closure unwinds.
Source§

fn graph_prepare(device: &DispatchDevice) -> Result<(), ExecutionError>

Prepare memory and metadata for graph-capture warmup.
Source§

fn graph_start_capture(device: &DispatchDevice) -> Result<(), ExecutionError>

Begin recording a warmed computation.
Source§

fn graph_stop_capture( device: &DispatchDevice, ) -> Result<BackendGraph, ExecutionError>

End recording, resetting capture state on failure as well as success.
Source§

fn graph_abort_capture(device: &DispatchDevice)

Close an abandoned recording.
Source§

fn dtype_usage(device: &DispatchDevice, dtype: DType) -> DTypeUsageSet

Returns the DTypeUsageSet for the given DType on the specified device.
Source§

fn staging<'a, Iter: Iterator<Item = &'a mut TensorData>>( data: Iter, device: &DispatchDevice, )

Marks the given data as being used as a staging buffer for transfer between CPU and accelerators like GPUs. Read more
Source§

fn device_count(type_id: u16) -> usize

Returns the number of devices available on this backend. device is a reference device used to determine the underlying backend that should be queried. A CUDA device will return all devices available to CUDA, a Vulkan device will return all devices available to Vulkan, etc.
Source§

unsafe fn graph_replay( _device: &Self::Device, graph: &BackendGraph, ) -> Result<(), ExecutionError>

Replay a recorded computation on its capture stream. Read more
Source§

fn supports_dtype(device: &Self::Device, dtype: DType) -> bool

Whether the type is fully supported by the specified device for general operations. Read more
Source§

impl BackendTypes for Dispatch

Source§

type Device = DispatchDevice

Device type.
Source§

type FloatTensorPrimitive = DispatchTensor

Tensor primitive to be used for all float operations.
Source§

type IntTensorPrimitive = DispatchTensor

Tensor primitive to be used for all int operations.
Source§

type BoolTensorPrimitive = DispatchTensor

Tensor primitive to be used for all bool operations.
Source§

type QuantizedTensorPrimitive = DispatchTensor

Tensor primitive to be used for all quantized operations.
Source§

type FloatElem = f32

Default float element type.
Source§

type IntElem = i32

Int element type.
Source§

type BoolElem = bool

Tensor primitive to be used for all bool operations.
Source§

impl BoolTensorOps<Dispatch> for Dispatch

Source§

fn bool_autodiff_context(tensor: &BoolTensor<Self>) -> AutodiffContext

Runtime association used when combining masks and floating-point values.
Source§

fn bool_with_autodiff_context( tensor: BoolTensor<Self>, context: AutodiffContext, ) -> BoolTensor<Self>

Change the runtime association without changing boolean storage.
Source§

fn bool_empty( shape: Shape, device: &Device<Self>, dtype: BoolDType, ) -> BoolTensor<Self>

Creates a new bool tensor. Read more
Source§

fn bool_zeros( shape: Shape, device: &Device<Self>, dtype: BoolDType, ) -> BoolTensor<Self>

Creates a new bool tensor filled false. Read more
Source§

fn bool_ones( shape: Shape, device: &Device<Self>, dtype: BoolDType, ) -> BoolTensor<Self>

Creates a new bool tensor filled true. Read more
Source§

fn bool_into_data( tensor: BoolTensor<Self>, ) -> impl Future<Output = Result<TensorData, ExecutionError>> + Send

Converts the tensor to a data structure. Read more
Source§

fn bool_from_data(data: TensorData, device: &Device<Self>) -> BoolTensor<Self>

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

fn bool_into_int( tensor: BoolTensor<Self>, out_dtype: IntDType, ) -> IntTensor<Self>

Converts bool tensor to int tensor. Read more
Source§

fn bool_into_float( tensor: BoolTensor<Self>, out_dtype: FloatDType, ) -> FloatTensor<Self>

Converts bool tensor to float tensor. Read more
Source§

fn bool_device(tensor: &BoolTensor<Self>) -> Device<Self>

Gets the device of the tensor. Read more
Source§

fn bool_to_device( tensor: BoolTensor<Self>, device: &Device<Self>, ) -> BoolTensor<Self>

Moves the tensor to the device.
Source§

fn bool_reshape(tensor: BoolTensor<Self>, shape: Shape) -> BoolTensor<Self>

Reshapes the tensor. Read more
Source§

fn bool_slice(tensor: BoolTensor<Self>, slices: &[Slice]) -> BoolTensor<Self>

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

fn bool_slice_assign( tensor: BoolTensor<Self>, slices: &[Slice], value: BoolTensor<Self>, ) -> BoolTensor<Self>

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

fn bool_mask_where( tensor: BoolTensor<Self>, mask: BoolTensor<Self>, value: BoolTensor<Self>, ) -> BoolTensor<Self>

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

fn bool_mask_fill( tensor: BoolTensor<Self>, mask: BoolTensor<Self>, value: Scalar, ) -> BoolTensor<Self>

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

fn bool_gather( dim: usize, tensor: BoolTensor<Self>, indices: IntTensor<Self>, ) -> BoolTensor<Self>

Gather elements from the tensor at the given indices. Read more
Source§

fn bool_scatter_or( dim: usize, tensor: BoolTensor<Self>, indices: IntTensor<Self>, value: BoolTensor<Self>, ) -> BoolTensor<Self>

Scatter a given value to the tensor at the given indices using boolean or reduction. Read more
Source§

fn bool_select( tensor: BoolTensor<Self>, dim: usize, indices: IntTensor<Self>, ) -> BoolTensor<Self>

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

fn bool_select_or( tensor: BoolTensor<Self>, dim: usize, indices: IntTensor<Self>, value: BoolTensor<Self>, ) -> BoolTensor<Self>

Assign the selected elements along the given dimension corresponding to the given indices to the given value using sum reduction. Read more
Source§

fn bool_repeat_dim( tensor: BoolTensor<Self>, dim: usize, times: usize, ) -> BoolTensor<Self>

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

fn bool_cat(tensors: Vec<BoolTensor<Self>>, dim: usize) -> BoolTensor<Self>

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

fn bool_equal(lhs: BoolTensor<Self>, rhs: BoolTensor<Self>) -> BoolTensor<Self>

Equates the two tensors. Read more
Source§

fn bool_not_equal( lhs: BoolTensor<Self>, rhs: BoolTensor<Self>, ) -> BoolTensor<Self>

Element-wise non-equality comparison. Read more
Source§

fn bool_equal_elem(lhs: BoolTensor<Self>, rhs: Scalar) -> BoolTensor<Self>

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

fn bool_not_equal_elem(lhs: BoolTensor<Self>, rhs: Scalar) -> BoolTensor<Self>

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

fn bool_not(tensor: BoolTensor<Self>) -> BoolTensor<Self>

Inverses boolean values. Read more
Source§

fn bool_and(lhs: BoolTensor<Self>, rhs: BoolTensor<Self>) -> BoolTensor<Self>

Executes the logical and (&&) operation on two boolean tensors. Read more
Source§

fn bool_or(lhs: BoolTensor<Self>, rhs: BoolTensor<Self>) -> BoolTensor<Self>

Executes the logical or (||) operation on two boolean tensors. Read more
Source§

fn bool_xor(lhs: BoolTensor<Self>, rhs: BoolTensor<Self>) -> BoolTensor<Self>

Element-wise exclusive or. Read more
Source§

fn bool_transpose(tensor: BoolTensor<Self>) -> BoolTensor<Self>

Transposes a bool tensor. Read more
Source§

fn bool_swap_dims( tensor: BoolTensor<Self>, dim1: usize, dim2: usize, ) -> BoolTensor<Self>

Swaps two dimensions of a bool tensor. Read more
Source§

fn bool_permute(tensor: BoolTensor<Self>, axes: &[usize]) -> BoolTensor<Self>

Permutes the dimensions of a tensor. Read more
Source§

fn bool_flip(tensor: BoolTensor<Self>, axes: &[usize]) -> BoolTensor<Self>

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

fn bool_any(tensor: BoolTensor<Self>) -> BoolTensor<Self>

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

fn bool_any_dim(tensor: BoolTensor<Self>, dim: usize) -> BoolTensor<Self>

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

fn bool_all(tensor: BoolTensor<Self>) -> BoolTensor<Self>

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

fn bool_all_dim(tensor: BoolTensor<Self>, dim: usize) -> BoolTensor<Self>

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

fn bool_argwhere( tensor: BoolTensor<Self>, out_dtype: IntDType, ) -> impl Future<Output = IntTensor<Self>> + 'static + Send

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

fn bool_expand(tensor: BoolTensor<Self>, shape: Shape) -> BoolTensor<Self>

Broadcasts the bool tensor to the given shape.
Source§

fn bool_unfold( tensor: BoolTensor<Self>, dim: usize, size: usize, step: usize, ) -> BoolTensor<Self>

Unfold windows along a dimension. Read more
Source§

impl Clone for Dispatch

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Dispatch

Source§

impl Debug for Dispatch

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Dispatch

Source§

fn default() -> Self

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

impl FloatTensorOps<Dispatch> for Dispatch

Source§

fn float_from_data(data: TensorData, device: &Device<Self>) -> FloatTensor<Self>

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

fn float_random( shape: Shape, distribution: Distribution, device: &Device<Self>, dtype: FloatDType, ) -> FloatTensor<Self>

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

fn float_zeros( shape: Shape, device: &Device<Self>, dtype: FloatDType, ) -> FloatTensor<Self>

Creates a new tensor with zeros. Read more
Source§

fn float_ones( shape: Shape, device: &Device<Self>, dtype: FloatDType, ) -> FloatTensor<Self>

Creates a new tensor with ones. Read more
Source§

fn float_full( shape: Shape, fill_value: Scalar, device: &Device<Self>, dtype: FloatDType, ) -> FloatTensor<Self>

Creates a tensor filled with given value. Read more
Source§

fn float_into_data( tensor: FloatTensor<Self>, ) -> impl Future<Output = Result<TensorData, ExecutionError>> + Send

Converts the tensor to a data structure. Read more
Source§

fn float_device(tensor: &FloatTensor<Self>) -> Device<Self>

Gets the device of the tensor. Read more
Source§

fn float_to_device( tensor: FloatTensor<Self>, device: &Device<Self>, ) -> FloatTensor<Self>

Moves the tensor to the given device. Read more
Source§

fn float_into_int( tensor: FloatTensor<Self>, out_dtype: IntDType, ) -> IntTensor<Self>

Converts float tensor to int tensor. Read more
Source§

fn float_empty( shape: Shape, device: &Device<Self>, dtype: FloatDType, ) -> FloatTensor<Self>

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

fn float_repeat_dim( tensor: FloatTensor<Self>, dim: usize, times: usize, ) -> FloatTensor<Self>

Repeat the tensor along the given dimension. Read more
Source§

fn float_add( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Adds two tensors together. Read more
Source§

fn float_add_scalar(lhs: FloatTensor<Self>, rhs: Scalar) -> FloatTensor<Self>

Adds a scalar to a tensor. Read more
Source§

fn float_clamp_min(tensor: FloatTensor<Self>, min: Scalar) -> FloatTensor<Self>

Clamps a tensor under a minimum value. Read more
Source§

fn float_clamp_max(tensor: FloatTensor<Self>, max: Scalar) -> FloatTensor<Self>

Clamps a tensor over a maximum value. Read more
Source§

fn float_clamp( tensor: FloatTensor<Self>, min: Scalar, max: Scalar, ) -> FloatTensor<Self>

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

fn float_sub( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Subtracts two tensors. Read more
Source§

fn float_sub_scalar(lhs: FloatTensor<Self>, rhs: Scalar) -> FloatTensor<Self>

Subtracts a scalar from a tensor. Read more
Source§

fn float_mul( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Multiplies two tensors together element-wise.
Source§

fn float_mul_scalar(lhs: FloatTensor<Self>, rhs: Scalar) -> FloatTensor<Self>

Multiplies a tensor by a scalar. Read more
Source§

fn float_div( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Divides two tensors element-wise. Read more
Source§

fn float_div_scalar(lhs: FloatTensor<Self>, rhs: Scalar) -> FloatTensor<Self>

Divides a tensor by a scalar. Read more
Source§

fn float_remainder( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Computes the remainder of division between two tensors element-wise. Read more
Source§

fn float_remainder_scalar( lhs: FloatTensor<Self>, rhs: Scalar, ) -> FloatTensor<Self>

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

fn float_matmul( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Multiplies two tensors together using matrix multiplication. Read more
Source§

fn float_cross( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, dim: usize, ) -> FloatTensor<Self>

Computes the cross product of two tensors along a given dimension. Read more
Source§

fn float_neg(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Negates a tensor element-wise.
Source§

fn float_recip(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Calculates the reciprocals element-wise
Source§

fn float_transpose(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Transposes a tensor. Read more
Source§

fn float_swap_dims( tensor: FloatTensor<Self>, dim1: usize, dim2: usize, ) -> FloatTensor<Self>

Swaps two dimensions of a tensor. Read more
Source§

fn float_permute(tensor: FloatTensor<Self>, axes: &[usize]) -> FloatTensor<Self>

Permutes the dimensions of a tensor. Read more
Source§

fn float_flip(tensor: FloatTensor<Self>, axes: &[usize]) -> FloatTensor<Self>

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

fn float_reshape(tensor: FloatTensor<Self>, shape: Shape) -> FloatTensor<Self>

Reshapes a tensor. Read more
Source§

fn float_gather( dim: usize, tensor: FloatTensor<Self>, indices: IntTensor<Self>, ) -> FloatTensor<Self>

Gather elements from a tensor. Read more
Source§

fn float_scatter_add( dim: usize, tensor: FloatTensor<Self>, indices: IntTensor<Self>, value: FloatTensor<Self>, ) -> FloatTensor<Self>

Scatter elements into a tensor using sum reduction. Read more
Source§

fn float_scatter( dim: usize, tensor: FloatTensor<Self>, indices: IntTensor<Self>, value: FloatTensor<Self>, update: IndexingUpdateOp, ) -> FloatTensor<Self>

Scatter with the specified update operation.
Source§

fn float_scatter_nd( _data: FloatTensor<Self>, _indices: IntTensor<Self>, _values: FloatTensor<Self>, _reduction: IndexingUpdateOp, ) -> FloatTensor<Self>

Multi-dimensional scatter: update data at locations specified by indices with values. Read more
Source§

fn float_gather_nd( _data: FloatTensor<Self>, _indices: IntTensor<Self>, ) -> FloatTensor<Self>

Multi-dimensional gather: collect slices from data at locations specified by indices. Read more
Source§

fn float_select( tensor: FloatTensor<Self>, dim: usize, indices: IntTensor<Self>, ) -> FloatTensor<Self>

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

fn float_select_add( tensor: FloatTensor<Self>, dim: usize, indices: IntTensor<Self>, value: FloatTensor<Self>, ) -> FloatTensor<Self>

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

fn float_select_assign( tensor: FloatTensor<Self>, dim: usize, indices: IntTensor<Self>, value: FloatTensor<Self>, update: IndexingUpdateOp, ) -> FloatTensor<Self>

Update selected slices using the specified operation.
Source§

fn float_slice(tensor: FloatTensor<Self>, slices: &[Slice]) -> FloatTensor<Self>

Select tensor elements corresponding to the given slices. Read more
Source§

fn float_slice_assign( tensor: FloatTensor<Self>, slices: &[Slice], value: FloatTensor<Self>, ) -> FloatTensor<Self>

Assign the selected elements corresponding to the given slices to the given value. Read more
Source§

fn float_mask_where( tensor: FloatTensor<Self>, mask: BoolTensor<Self>, value: FloatTensor<Self>, ) -> FloatTensor<Self>

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

fn float_mask_fill( tensor: FloatTensor<Self>, mask: BoolTensor<Self>, value: Scalar, ) -> FloatTensor<Self>

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

fn float_equal( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Equal comparison of two tensors. Read more
Source§

fn float_not_equal( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Element-wise non-equality comparison. Read more
Source§

fn float_equal_elem( lhs: FloatTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_not_equal_elem( lhs: FloatTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_greater( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Greater than comparison of two tensors. Read more
Source§

fn float_greater_elem( lhs: FloatTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_greater_equal( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_greater_equal_elem( lhs: FloatTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_lower( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Less than comparison of two tensors. Read more
Source§

fn float_lower_elem( lhs: FloatTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_lower_equal( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_lower_equal_elem( lhs: FloatTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_detach(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Detaches a tensor from the computation graph.
Source§

fn float_set_require_grad( tensor: FloatTensor<Self>, _require_grad: bool, ) -> FloatTensor<Self>

Sets the require_grad flag of a tensor.
Source§

fn float_is_require_grad(_tensor: &FloatTensor<Self>) -> bool

Returns the require_grad flag of a tensor.
Source§

fn float_is_tracked(tensor: &FloatTensor<Self>) -> bool

Whether the tensor belongs to a recorded graph, independently of gradient retention.
Source§

fn float_gradient_checkpointing_strategy( _tensor: &FloatTensor<Self>, ) -> Option<GradientCheckpointingStrategy>

The tensor’s checkpointing policy, or None without autodiff.
Source§

fn float_autodiff_context(tensor: &FloatTensor<Self>) -> AutodiffContext

Runtime autodiff association of a floating tensor.
Source§

fn float_with_autodiff_context( tensor: FloatTensor<Self>, context: AutodiffContext, ) -> FloatTensor<Self>

Change runtime association on a backend supporting dynamic autodiff.
Source§

fn float_with_gradient_checkpointing_strategy( _tensor: FloatTensor<Self>, _strategy: GradientCheckpointingStrategy, ) -> FloatTensor<Self>

Override the tensor’s policy without detaching it from its current graph.
Source§

fn float_sum(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Sum of all elements in a tensor. Read more
Source§

fn float_sum_dim(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

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

fn float_prod(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Product of all elements in a tensor. Read more
Source§

fn float_prod_dim(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

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

fn float_mean(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Mean of all elements in a tensor. Read more
Source§

fn float_mean_dim(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

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

fn float_cumsum(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

Computes the cumulative sum of elements along a dimension. Read more
Source§

fn float_cumprod(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

Computes the cumulative product of elements along a dimension. Read more
Source§

fn float_cummin(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

Computes the cumulative minimum of elements along a dimension. Read more
Source§

fn float_cummax(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

Computes the cumulative maximum of elements along a dimension. Read more
Source§

fn float_cast(tensor: FloatTensor<Self>, dtype: FloatDType) -> FloatTensor<Self>

Converts a tensor to another floating point data type. Read more
Source§

fn float_exp(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with exponential values. Read more
Source§

fn float_log(tensor: FloatTensor<Self>) -> FloatTensor<Self>

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

fn float_log1p(tensor: FloatTensor<Self>) -> FloatTensor<Self>

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

fn float_powf( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Element-wise power with a FloatTensor. Read more
Source§

fn float_powi(lhs: FloatTensor<Self>, rhs: IntTensor<Self>) -> FloatTensor<Self>

Element-wise power with an IntTensor. Read more
Source§

fn float_powi_scalar(lhs: FloatTensor<Self>, rhs: Scalar) -> FloatTensor<Self>

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

fn float_powi_scalar_impl( lhs: FloatTensor<Self>, rhs: Scalar, ) -> FloatTensor<Self>

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

fn float_powf_scalar( tensor: FloatTensor<Self>, value: Scalar, ) -> FloatTensor<Self>

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

fn float_powf_scalar_impl( tensor: FloatTensor<Self>, value: Scalar, ) -> FloatTensor<Self>

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

fn float_sqrt(tensor: FloatTensor<Self>) -> FloatTensor<Self>

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

fn float_hypot( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Computes the element-wise hypotenuse without intermediate squaring overflow.
Source§

fn float_rsqrt(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns element-wise reciprocal square roots. Backends may provide a native instruction.
Source§

fn float_abs(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with absolute values. Read more
Source§

fn float_cos(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with cosine values. Read more
Source§

fn float_sin(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with sine values. Read more
Source§

fn float_tan(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with tangent values. Read more
Source§

fn float_cosh(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with hyperbolic cosine values. Read more
Source§

fn float_sinh(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with hyperbolic sine values. Read more
Source§

fn float_tanh(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with hyperbolic tangent values. Read more
Source§

fn float_acos(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with inverse cosine values. Read more
Source§

fn float_acosh(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with inverse hyperbolic cosine values. Read more
Source§

fn float_asin(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with inverse sine values. Read more
Source§

fn float_asinh(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with inverse hyperbolic sine values. Read more
Source§

fn float_atan(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with the inverse tangent values. Read more
Source§

fn float_atanh(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with the inverse hyperbolic tangent values. Read more
Source§

fn float_atan2( lhs: FloatTensor<Self>, rhs: FloatTensor<Self>, ) -> FloatTensor<Self>

Returns a tensor with the four-quadrant inverse tangent values of y and x. Read more
Source§

fn float_round(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with rounded values. Read more
Source§

fn float_floor(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with floored values. Read more
Source§

fn float_ceil(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with ceiled values. Read more
Source§

fn float_trunc(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns a new tensor with truncated values. Read more
Source§

fn float_erf(tensor: FloatTensor<Self>) -> FloatTensor<Self>

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

fn float_cat(tensors: Vec<FloatTensor<Self>>, dim: usize) -> FloatTensor<Self>

Concatenates tensors along a dimension. Read more
Source§

fn float_argmax( tensor: FloatTensor<Self>, dim: usize, out_dtype: IntDType, ) -> IntTensor<Self>

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

fn float_argtopk( tensor: FloatTensor<Self>, dim: usize, k: usize, out_dtype: IntDType, ) -> IntTensor<Self>

Gets the indices of the k maximum elements of a tensor along an axis. if two elements are equals, it will be ordered by lowest indices Read more
Source§

fn float_topk( tensor: FloatTensor<Self>, dim: usize, k: usize, ) -> FloatTensor<Self>

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

fn float_argmin( tensor: FloatTensor<Self>, dim: usize, out_dtype: IntDType, ) -> IntTensor<Self>

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

fn float_max(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Gets the maximum element of a tensor. Read more
Source§

fn float_max_dim(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

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

fn float_max_dim_with_indices( tensor: FloatTensor<Self>, dim: usize, indices_dtype: IntDType, ) -> (FloatTensor<Self>, IntTensor<Self>)

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

fn float_min(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Gets the minimum element of a tensor. Read more
Source§

fn float_min_dim(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

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

fn float_min_dim_with_indices( tensor: FloatTensor<Self>, dim: usize, indices_dtype: IntDType, ) -> (FloatTensor<Self>, IntTensor<Self>)

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

fn float_max_abs(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Gets the maximum absolute element of a tensor. Read more
Source§

fn float_max_abs_dim(tensor: FloatTensor<Self>, dim: usize) -> FloatTensor<Self>

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

fn float_any( tensor: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_any_dim( tensor: FloatTensor<Self>, dim: usize, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_all( tensor: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_all_dim( tensor: FloatTensor<Self>, dim: usize, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn float_sign(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Returns the signs of the float tensor. Read more
Source§

fn float_expand(tensor: FloatTensor<Self>, shape: Shape) -> FloatTensor<Self>

Broadcasts the float tensor to the given shape.
Source§

fn float_sort( tensor: FloatTensor<Self>, dim: usize, descending: bool, ) -> FloatTensor<Self>

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

fn float_sort_with_indices( tensor: FloatTensor<Self>, dim: usize, descending: bool, indices_dtype: IntDType, ) -> (FloatTensor<Self>, IntTensor<Self>)

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

fn float_argsort( tensor: FloatTensor<Self>, dim: usize, descending: bool, out_dtype: IntDType, ) -> IntTensor<Self>

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

fn float_grid_sample_2d( tensor: FloatTensor<Self>, grid: FloatTensor<Self>, options: GridSampleOptions, ) -> FloatTensor<Self>

Samples tensor as a two-dimensional spatial grid of (possibly multi-channel) values, using the given locations in [-1, 1]. Read more
Source§

fn float_unfold( tensor: FloatTensor<Self>, dim: usize, size: usize, step: usize, ) -> FloatTensor<Self>

Unfold windows along a dimension. Read more
Source§

fn float_is_nan( tensor: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Returns a new tensor with boolean elements indicating whether each element of the input is NaN. Read more
Source§

fn float_is_inf( tensor: FloatTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Returns a new tensor with boolean elements indicating whether each element of the input is infinite (either +INF or -INF). Read more
Source§

impl IntTensorOps<Dispatch> for Dispatch

Source§

fn int_autodiff_context(tensor: &IntTensor<Self>) -> AutodiffContext

Runtime association used when combining integer and floating-point values.
Source§

fn int_with_autodiff_context( tensor: IntTensor<Self>, context: AutodiffContext, ) -> IntTensor<Self>

Change the runtime association without changing integer storage.
Source§

fn int_empty( shape: Shape, device: &Device<Self>, dtype: IntDType, ) -> IntTensor<Self>

Creates a new int tensor. Read more
Source§

fn int_into_data( tensor: IntTensor<Self>, ) -> impl Future<Output = Result<TensorData, ExecutionError>> + Send

Converts the tensor to a data structure. Read more
Source§

fn int_from_data(data: TensorData, device: &Device<Self>) -> IntTensor<Self>

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

fn int_device(tensor: &IntTensor<Self>) -> Device<Self>

Gets the device of the tensor. Read more
Source§

fn int_to_device( tensor: IntTensor<Self>, device: &Device<Self>, ) -> IntTensor<Self>

Moves the tensor to the given device.
Source§

fn int_reshape(tensor: IntTensor<Self>, shape: Shape) -> IntTensor<Self>

Reshapes the tensor. Read more
Source§

fn int_slice(tensor: IntTensor<Self>, slices: &[Slice]) -> IntTensor<Self>

Gets the element at the given indices. Read more
Source§

fn int_slice_assign( tensor: IntTensor<Self>, slices: &[Slice], value: IntTensor<Self>, ) -> IntTensor<Self>

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

fn int_into_float( tensor: IntTensor<Self>, out_dtype: FloatDType, ) -> FloatTensor<Self>

Converts int tensor to float tensor. Read more
Source§

fn int_mask_where( tensor: IntTensor<Self>, mask: BoolTensor<Self>, value: IntTensor<Self>, ) -> IntTensor<Self>

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

fn int_mask_fill( tensor: IntTensor<Self>, mask: BoolTensor<Self>, value: Scalar, ) -> IntTensor<Self>

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

fn int_gather( dim: usize, tensor: IntTensor<Self>, indices: IntTensor<Self>, ) -> IntTensor<Self>

Gather elements from the tensor at the given indices. Read more
Source§

fn int_scatter_add( dim: usize, tensor: IntTensor<Self>, indices: IntTensor<Self>, value: IntTensor<Self>, ) -> IntTensor<Self>

Scatter a given value to the tensor at the given indices using sum reduction. Read more
Source§

fn int_scatter( dim: usize, tensor: IntTensor<Self>, indices: IntTensor<Self>, value: IntTensor<Self>, update: IndexingUpdateOp, ) -> IntTensor<Self>

Scatter with the specified update operation.
Source§

fn int_scatter_nd( _data: IntTensor<Self>, _indices: IntTensor<Self>, _values: IntTensor<Self>, _reduction: IndexingUpdateOp, ) -> IntTensor<Self>

Multi-dimensional scatter for int tensors.
Source§

fn int_gather_nd( _data: IntTensor<Self>, _indices: IntTensor<Self>, ) -> IntTensor<Self>

Multi-dimensional gather for int tensors.
Source§

fn int_select( tensor: IntTensor<Self>, dim: usize, indices: IntTensor<Self>, ) -> IntTensor<Self>

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

fn int_select_add( tensor: IntTensor<Self>, dim: usize, indices: IntTensor<Self>, value: IntTensor<Self>, ) -> IntTensor<Self>

Assign the selected elements along the given dimension corresponding to the given indices to the given value using sum reduction. Read more
Source§

fn int_select_assign( tensor: IntTensor<Self>, dim: usize, indices: IntTensor<Self>, value: IntTensor<Self>, update: IndexingUpdateOp, ) -> IntTensor<Self>

Update selected slices using the specified operation.
Source§

fn int_repeat_dim( tensor: IntTensor<Self>, dim: usize, times: usize, ) -> IntTensor<Self>

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

fn int_cat(tensors: Vec<IntTensor<Self>>, dim: usize) -> IntTensor<Self>

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

fn int_equal( lhs: IntTensor<Self>, rhs: IntTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Element-wise equality comparison. Read more
Source§

fn int_not_equal( lhs: IntTensor<Self>, rhs: IntTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Element-wise non-equality comparison. Read more
Source§

fn int_equal_elem( lhs: IntTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_not_equal_elem( lhs: IntTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_greater( lhs: IntTensor<Self>, rhs: IntTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Element-wise greater than comparison. Read more
Source§

fn int_greater_elem( lhs: IntTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_greater_equal( lhs: IntTensor<Self>, rhs: IntTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_greater_equal_elem( lhs: IntTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_lower( lhs: IntTensor<Self>, rhs: IntTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

Element-wise less than comparison. Read more
Source§

fn int_lower_elem( lhs: IntTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_lower_equal( lhs: IntTensor<Self>, rhs: IntTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_lower_equal_elem( lhs: IntTensor<Self>, rhs: Scalar, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_add(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Element-wise addition. Read more
Source§

fn int_add_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Element-wise addition with a scalar. Read more
Source§

fn int_powi(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Element-wise power with a IntTensor. Read more
Source§

fn int_powi_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

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

fn int_powi_scalar_impl(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

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

fn int_clamp_min(tensor: IntTensor<Self>, min: Scalar) -> IntTensor<Self>

Clamps a tensor under a minimum value. Read more
Source§

fn int_clamp_max(tensor: IntTensor<Self>, max: Scalar) -> IntTensor<Self>

Clamps a tensor over a maximum value. Read more
Source§

fn int_clamp( tensor: IntTensor<Self>, min: Scalar, max: Scalar, ) -> IntTensor<Self>

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

fn int_sub(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Element-wise subtraction. Read more
Source§

fn int_sub_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Element-wise subtraction with a scalar. Read more
Source§

fn int_mul(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Element-wise multiplication. Read more
Source§

fn int_mul_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Element-wise multiplication with a scalar. Read more
Source§

fn int_div(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Element-wise division. Read more
Source§

fn int_div_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Element-wise division with a scalar. Read more
Source§

fn int_remainder(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Element-wise modulus. Read more
Source§

fn int_remainder_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Element-wise modulus with a scalar. Read more
Source§

fn int_matmul(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Multiplies two tensors together using matrix multiplication. Read more
Source§

fn int_neg(tensor: IntTensor<Self>) -> IntTensor<Self>

Element-wise negation. Read more
Source§

fn int_zeros( shape: Shape, device: &Device<Self>, dtype: IntDType, ) -> IntTensor<Self>

Creates a tensor of zeros. Read more
Source§

fn int_ones( shape: Shape, device: &Device<Self>, dtype: IntDType, ) -> IntTensor<Self>

Creates a tensor of ones. Read more
Source§

fn int_full( shape: Shape, fill_value: Scalar, device: &Device<Self>, dtype: IntDType, ) -> IntTensor<Self>

Creates a tensor filled with given value. Read more
Source§

fn int_sum(tensor: IntTensor<Self>) -> IntTensor<Self>

Sums all elements in the tensor. Read more
Source§

fn int_sum_dim(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_prod(tensor: IntTensor<Self>) -> IntTensor<Self>

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

fn int_prod_dim(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_mean(tensor: IntTensor<Self>) -> IntTensor<Self>

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

fn int_mean_dim(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_cumsum(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

Computes the cumulative sum of elements along a dimension. Read more
Source§

fn int_cumprod(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

Computes the cumulative product of elements along a dimension. Read more
Source§

fn int_cummin(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

Computes the cumulative minimum of elements along a dimension. Read more
Source§

fn int_cummax(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

Computes the cumulative maximum of elements along a dimension. Read more
Source§

fn int_argmax(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_argtopk(tensor: IntTensor<Self>, dim: usize, k: usize) -> IntTensor<Self>

Gets the indices of the k maximum elements along a dimension. If two elements share the same value, it will be ordered by the lowest coordinate Read more
Source§

fn int_topk(tensor: IntTensor<Self>, dim: usize, k: usize) -> IntTensor<Self>

Gets the values of the k maximum elements along a dimension. Read more
Source§

fn int_argmin(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_max(tensor: IntTensor<Self>) -> IntTensor<Self>

Gets the maximum element in the tensor. Read more
Source§

fn int_max_dim(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_max_dim_with_indices( tensor: IntTensor<Self>, dim: usize, ) -> (IntTensor<Self>, IntTensor<Self>)

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

fn int_max_abs(tensor: IntTensor<Self>) -> IntTensor<Self>

Gets the maximum absolute element in the tensor. Read more
Source§

fn int_max_abs_dim(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_min(tensor: IntTensor<Self>) -> IntTensor<Self>

Gets the minimum element in the tensor. Read more
Source§

fn int_min_dim(tensor: IntTensor<Self>, dim: usize) -> IntTensor<Self>

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

fn int_min_dim_with_indices( tensor: IntTensor<Self>, dim: usize, ) -> (IntTensor<Self>, IntTensor<Self>)

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

fn int_abs(tensor: IntTensor<Self>) -> IntTensor<Self>

Returns a new tensor with absolute values. Read more
Source§

fn int_transpose(tensor: IntTensor<Self>) -> IntTensor<Self>

Transposes an int tensor. Read more
Source§

fn int_swap_dims( tensor: IntTensor<Self>, dim1: usize, dim2: usize, ) -> IntTensor<Self>

Swaps two dimensions of an int tensor. Read more
Source§

fn int_permute(tensor: IntTensor<Self>, axes: &[usize]) -> IntTensor<Self>

Permutes the dimensions of a tensor. Read more
Source§

fn int_flip(tensor: IntTensor<Self>, axes: &[usize]) -> IntTensor<Self>

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

fn int_random( shape: Shape, distribution: Distribution, device: &Device<Self>, dtype: IntDType, ) -> IntTensor<Self>

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

fn int_arange_step( range: Range<i64>, step: usize, device: &Device<Self>, dtype: IntDType, ) -> IntTensor<Self>

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

fn int_arange( range: Range<i64>, device: &Device<Self>, dtype: IntDType, ) -> IntTensor<Self>

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

fn int_any(tensor: IntTensor<Self>, out_dtype: BoolDType) -> BoolTensor<Self>

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

fn int_any_dim( tensor: IntTensor<Self>, dim: usize, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_all(tensor: IntTensor<Self>, out_dtype: BoolDType) -> BoolTensor<Self>

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

fn int_all_dim( tensor: IntTensor<Self>, dim: usize, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn int_sign(tensor: IntTensor<Self>) -> IntTensor<Self>

Returns the signs of the int tensor. Read more
Source§

fn int_expand(tensor: IntTensor<Self>, shape: Shape) -> IntTensor<Self>

Broadcasts the int tensor to the given shape.
Source§

fn int_sort( tensor: IntTensor<Self>, dim: usize, descending: bool, ) -> IntTensor<Self>

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

fn int_sort_with_indices( tensor: IntTensor<Self>, dim: usize, descending: bool, ) -> (IntTensor<Self>, IntTensor<Self>)

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

fn int_argsort( tensor: IntTensor<Self>, dim: usize, descending: bool, ) -> IntTensor<Self>

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

fn bitwise_and(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Bitwise AND operation for Int Tensors
Source§

fn bitwise_and_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Bitwise AND operation for Int Tensors with a scalar
Source§

fn bitwise_or(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Bitwise OR operation for Int Tensors
Source§

fn bitwise_or_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Bitwise OR operation for Int Tensors with a scalar
Source§

fn bitwise_xor(lhs: IntTensor<Self>, rhs: IntTensor<Self>) -> IntTensor<Self>

Bitwise XOR operation for Int Tensors
Source§

fn bitwise_xor_scalar(lhs: IntTensor<Self>, rhs: Scalar) -> IntTensor<Self>

Bitwise XOR operation for Int Tensors with a scalar
Source§

fn bitwise_not(tensor: IntTensor<Self>) -> IntTensor<Self>

Bitwise NOT operation for Int Tensors
Source§

fn bitwise_left_shift( lhs: IntTensor<Self>, rhs: IntTensor<Self>, ) -> IntTensor<Self>

Bitwise left shift operation for Int Tensors
Source§

fn bitwise_left_shift_scalar( lhs: IntTensor<Self>, rhs: Scalar, ) -> IntTensor<Self>

Bitwise left shift operation for Int Tensors with a scalar
Source§

fn bitwise_right_shift( lhs: IntTensor<Self>, rhs: IntTensor<Self>, ) -> IntTensor<Self>

Bitwise right shift operation for Int Tensors
Source§

fn bitwise_right_shift_scalar( lhs: IntTensor<Self>, rhs: Scalar, ) -> IntTensor<Self>

Bitwise right shift operation for Int Tensors with a scalar
Source§

fn int_cast(tensor: IntTensor<Self>, dtype: IntDType) -> IntTensor<Self>

Converts a tensor to another integer data type. Read more
Source§

fn int_unfold( tensor: IntTensor<Self>, dim: usize, size: usize, step: usize, ) -> IntTensor<Self>

Unfold windows along a dimension. Read more
Source§

impl ModuleOps<Dispatch> for Dispatch

Source§

fn batch_norm( x: FloatTensor<Self>, gamma: FloatTensor<Self>, beta: FloatTensor<Self>, mean: FloatTensor<Self>, variance: FloatTensor<Self>, epsilon: f64, ) -> FloatTensor<Self>

Normalize [batch, channels, ...] using supplied [channels] statistics.
Source§

fn batch_norm_train( x: FloatTensor<Self>, gamma: FloatTensor<Self>, beta: FloatTensor<Self>, epsilon: f64, ) -> BatchNormTrain<Self>

Normalize using batch statistics, returning the mean and biased variance. Autodiff differentiates the output as one operation and detaches the statistics.
Source§

fn batch_norm_train_backward( x: FloatTensor<Self>, gamma: FloatTensor<Self>, mean: FloatTensor<Self>, variance: FloatTensor<Self>, epsilon: f64, output_grad: FloatTensor<Self>, ) -> BatchNormTrainBackward<Self>

Differentiate the normalized output using its saved batch mean and variance.
Source§

fn exponential_relu_native( tensor: FloatTensor<Self>, alpha: f64, continuous: bool, ) -> FloatTensor<Self>

Working-storage ELU, or CELU when continuous is true, using the original alpha.
Source§

fn exponential_relu_native_backward( tensor: FloatTensor<Self>, grad: FloatTensor<Self>, alpha: f64, continuous: bool, ) -> FloatTensor<Self>

Original selected ELU/CELU mode’s independent first-order input derivative.
Source§

fn leaky_relu_native( tensor: FloatTensor<Self>, negative_slope: f64, ) -> FloatTensor<Self>

Working-storage LeakyReLU using the actual scalar negative slope.
Source§

fn leaky_relu_native_backward( tensor: FloatTensor<Self>, grad: FloatTensor<Self>, negative_slope: f64, ) -> FloatTensor<Self>

Independent first-order VJP, using the original primal to select the branch.
Source§

fn prelu_native( tensor: FloatTensor<Self>, alpha: FloatTensor<Self>, ) -> FloatTensor<Self>

Working-storage PReLU with the original shared or per-channel slope vector.
Source§

fn prelu_native_backward_select( tensor: FloatTensor<Self>, alpha: FloatTensor<Self>, grad: FloatTensor<Self>, mask: [bool; 2], ) -> [Option<FloatTensor<Self>>; 2]

Independently requested original-input and slope derivatives.
Source§

fn group_norm( tensor: FloatTensor<Self>, gamma: Option<FloatTensor<Self>>, beta: Option<FloatTensor<Self>>, groups: usize, epsilon: f64, ) -> FloatTensor<Self>

Native GroupNorm on actual channel groups with independently optional affine leaves.
Source§

fn group_norm_with_stats( tensor: FloatTensor<Self>, gamma: Option<FloatTensor<Self>>, beta: Option<FloatTensor<Self>>, groups: usize, epsilon: f64, ) -> LayerNormOutput<Self>

GroupNorm output and FP32/FP64 saved [batch, groups] mean/reciprocal deviation.
Source§

fn group_norm_backward_select( tensor: FloatTensor<Self>, gamma: Option<FloatTensor<Self>>, grad: FloatTensor<Self>, mean: FloatTensor<Self>, rstd: FloatTensor<Self>, groups: usize, mask: [bool; 3], ) -> [Option<FloatTensor<Self>>; 3]

Only requested original input, actual weight and bias derivatives, in that order.
Source§

fn gelu_native( tensor: FloatTensor<Self>, approximate: bool, ) -> FloatTensor<Self>

Explicit native GELU preserving the caller’s original erf/tanh approximation choice.
Source§

fn gelu_native_backward( input: FloatTensor<Self>, grad: FloatTensor<Self>, approximate: bool, ) -> FloatTensor<Self>

Independent first-order GELU VJP in the same selected erf/tanh mode.
Source§

fn silu_native(tensor: FloatTensor<Self>) -> FloatTensor<Self>

Explicit native SiLU training path, using FP32 for half activation arithmetic.
Source§

fn silu_native_backward( input: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Independent first-order SiLU VJP, retaining the original input storage.
Source§

fn softmax_native( tensor: FloatTensor<Self>, dim: usize, logarithmic: bool, ) -> FloatTensor<Self>

Explicit saved-working-output softmax path; existing activation defaults are unchanged.
Source§

fn softmax_with_stats( tensor: FloatTensor<Self>, dim: usize, logarithmic: bool, ) -> SoftmaxOutput<Self>

Softmax/log-softmax retaining its working output, with FP32 low-precision arithmetic.
Source§

fn softmax_native_backward( working: FloatTensor<Self>, grad: FloatTensor<Self>, dim: usize, logarithmic: bool, ) -> FloatTensor<Self>

VJP from the saved working output, retaining FP64 if either argument uses FP64.
Source§

fn embedding( weights: FloatTensor<Self>, indices: IntTensor<Self>, ) -> FloatTensor<Self>

Embedding operation. Read more
Source§

fn embedding_backward( weights: FloatTensor<Self>, output_grad: FloatTensor<Self>, indices: IntTensor<Self>, ) -> FloatTensor<Self>

Embedding backward operation. Read more
Source§

fn linear( x: FloatTensor<Self>, weight: FloatTensor<Self>, bias: Option<FloatTensor<Self>>, ) -> FloatTensor<Self>

Linear transformation. Read more
Source§

fn linear_x_backward( weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Backward pass for linear, returning the gradient for x.
Source§

fn linear_weight_backward( x: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Backward pass for linear, returning the gradient for weight.
Source§

fn linear_bias_backward(output_grad: FloatTensor<Self>) -> FloatTensor<Self>

Backward pass for linear, returning the gradient for bias.
Source§

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

One dimensional convolution. Read more
Source§

fn conv1d_x_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvOptions<1>, ) -> FloatTensor<Self>

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

fn conv1d_weight_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvOptions<1>, ) -> FloatTensor<Self>

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

fn conv1d_bias_backward( x: FloatTensor<Self>, bias: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

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

Two dimensional convolution. Read more
Source§

fn conv2d_x_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvOptions<2>, ) -> FloatTensor<Self>

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

fn conv2d_weight_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvOptions<2>, ) -> FloatTensor<Self>

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

fn conv2d_bias_backward( x: FloatTensor<Self>, bias: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

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

Two dimensional deformable convolution. Read more
Source§

fn deform_conv2d_backward( x: FloatTensor<Self>, offset: FloatTensor<Self>, weight: FloatTensor<Self>, mask: Option<FloatTensor<Self>>, bias: Option<FloatTensor<Self>>, output_grad: FloatTensor<Self>, options: DeformConvOptions<2>, ) -> DeformConv2dBackward<Self>

Backward pass for the deform_conv2d operation.
Source§

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

Three dimensional convolution. Read more
Source§

fn conv3d_x_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvOptions<3>, ) -> FloatTensor<Self>

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

fn conv3d_weight_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvOptions<3>, ) -> FloatTensor<Self>

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

fn conv3d_bias_backward( x: FloatTensor<Self>, bias: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

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

One dimensional transposed convolution. Read more
Source§

fn conv_transpose1d_x_backward( weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvTransposeOptions<1>, ) -> FloatTensor<Self>

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

fn conv_transpose1d_weight_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvTransposeOptions<1>, ) -> FloatTensor<Self>

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

fn conv_transpose1d_bias_backward( x: FloatTensor<Self>, bias: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

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

Two dimensional transposed convolution. Read more
Source§

fn conv_transpose2d_x_backward( weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvTransposeOptions<2>, ) -> FloatTensor<Self>

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

fn conv_transpose2d_weight_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvTransposeOptions<2>, ) -> FloatTensor<Self>

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

fn conv_transpose2d_bias_backward( x: FloatTensor<Self>, bias: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

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

Three dimensional transposed convolution. Read more
Source§

fn conv_transpose3d_x_backward( weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvTransposeOptions<3>, ) -> FloatTensor<Self>

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

fn conv_transpose3d_weight_backward( x: FloatTensor<Self>, weight: FloatTensor<Self>, output_grad: FloatTensor<Self>, options: ConvTransposeOptions<3>, ) -> FloatTensor<Self>

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

fn conv_transpose3d_bias_backward( x: FloatTensor<Self>, bias: FloatTensor<Self>, output_grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

fn unfold4d( x: FloatTensor<Self>, kernel_size: [usize; 2], options: UnfoldOptions, ) -> FloatTensor<Self>

Four-dimensional unfolding. Read more
Source§

fn fold4d( x: FloatTensor<Self>, output_size: [usize; 2], kernel_size: [usize; 2], options: UnfoldOptions, ) -> FloatTensor<Self>

Fold [batch, channels * kernel_area, blocks] into NCHW, summing overlaps. The grouped one-hot transposed convolution is the adjoint of Self::unfold4d.
Source§

fn avg_pool1d( x: FloatTensor<Self>, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ceil_mode: bool, ) -> FloatTensor<Self>

One dimensional avg pooling. Read more
Source§

fn avg_pool1d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ceil_mode: bool, ) -> FloatTensor<Self>

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

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

Two dimensional avg pooling. Read more
Source§

fn avg_pool2d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ceil_mode: bool, ) -> FloatTensor<Self>

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

fn avg_pool3d( x: FloatTensor<Self>, kernel_size: [usize; 3], stride: [usize; 3], padding: [usize; 3], count_include_pad: bool, ceil_mode: bool, ) -> FloatTensor<Self>

Three dimensional average pooling of [batch, channels, depth, height, width].
Source§

fn avg_pool3d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, kernel_size: [usize; 3], stride: [usize; 3], padding: [usize; 3], count_include_pad: bool, ceil_mode: bool, ) -> FloatTensor<Self>

Input gradients for three dimensional average pooling.
Source§

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

Two dimensional adaptive avg pooling. Read more
Source§

fn adaptive_avg_pool2d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

fn adaptive_avg_pool3d( x: FloatTensor<Self>, output_size: [usize; 3], ) -> FloatTensor<Self>

Three dimensional adaptive average pooling of [batch, channels, depth, height, width].
Source§

fn adaptive_avg_pool3d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

Input gradients for native three dimensional adaptive average pooling.
Source§

fn max_pool3d( x: FloatTensor<Self>, kernel: [usize; 3], stride: [usize; 3], padding: [usize; 3], dilation: [usize; 3], ceil: bool, ) -> FloatTensor<Self>

Three dimensional maximum pooling with native padding, stride and dilation.
Source§

fn max_pool3d_with_indices( x: FloatTensor<Self>, kernel: [usize; 3], stride: [usize; 3], padding: [usize; 3], dilation: [usize; 3], ceil: bool, ) -> MaxPool3dWithIndices<Self>

Volume maxima and original input positions.
Source§

fn max_pool3d_with_indices_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, indices: IntTensor<Self>, _kernel: [usize; 3], _stride: [usize; 3], _padding: [usize; 3], _dilation: [usize; 3], _ceil: bool, ) -> MaxPool3dBackward<Self>

Accumulate volume gradients through the saved maximum positions.
Source§

fn adaptive_avg_pool1d( x: FloatTensor<Self>, output_size: usize, ) -> FloatTensor<Self>

One dimensional adaptive avg pooling. Read more
Source§

fn adaptive_avg_pool1d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, ) -> FloatTensor<Self>

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

fn max_pool1d( x: FloatTensor<Self>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ceil_mode: bool, ) -> FloatTensor<Self>

One dimensional max pooling. Read more
Source§

fn max_pool1d_with_indices( x: FloatTensor<Self>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ceil_mode: bool, ) -> MaxPool1dWithIndices<Self>

One dimensional max pooling with indices. Read more
Source§

fn max_pool1d_with_indices_backward( x: FloatTensor<Self>, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ceil_mode: bool, output_grad: FloatTensor<Self>, indices: IntTensor<Self>, ) -> MaxPool1dBackward<Self>

Backward pass for the max pooling 1d operation.
Source§

fn max_pool2d( x: FloatTensor<Self>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ceil_mode: bool, ) -> FloatTensor<Self>

Two dimensional max pooling. Read more
Source§

fn max_pool2d_with_indices( x: FloatTensor<Self>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ceil_mode: bool, ) -> MaxPool2dWithIndices<Self>

Two dimensional max pooling with indices. Read more
Source§

fn max_pool2d_with_indices_backward( x: FloatTensor<Self>, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ceil_mode: bool, output_grad: FloatTensor<Self>, indices: IntTensor<Self>, ) -> MaxPool2dBackward<Self>

Backward pass for the max pooling 2d operation.
Source§

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

Down/up samples the input. Read more
Source§

fn interpolate_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, output_size: [usize; 2], options: InterpolateOptions, ) -> FloatTensor<Self>

Backward pass for the interpolate operation.
Source§

fn interpolate1d( x: FloatTensor<Self>, size: usize, options: InterpolateOptions, ) -> FloatTensor<Self>

Resize native [batch, channels, width] lines with the original filter.
Source§

fn interpolate1d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, size: usize, options: InterpolateOptions, ) -> FloatTensor<Self>

Backward line resizing in the original input geometry and storage.
Source§

fn interpolate3d( x: FloatTensor<Self>, size: [usize; 3], options: InterpolateOptions, ) -> FloatTensor<Self>

Resize native volumes using the existing spatial-then-depth filter sequence.
Source§

fn interpolate3d_backward( x: FloatTensor<Self>, grad: FloatTensor<Self>, size: [usize; 3], options: InterpolateOptions, ) -> FloatTensor<Self>

Backward volume resizing through the original spatial and depth filters.
Source§

fn attention( query: FloatTensor<Self>, key: FloatTensor<Self>, value: FloatTensor<Self>, mask: Option<BoolTensor<Self>>, attn_bias: Option<FloatTensor<Self>>, options: AttentionModuleOptions, ) -> FloatTensor<Self>

Computes scaled dot-product attention: softmax(QKᵗ * scale) · V, where scale defaults to 1/sqrt(head_dim). Optionally applies masking, additive bias, causal masking, and softcap to the attention scores. Read more
Source§

fn layer_norm( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, beta: Option<FloatTensor<Self>>, epsilon: f64, ) -> FloatTensor<Self>

Applies Layer Normalization over the last dimension of the input tensor. Read more
Source§

fn rms_norm( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, epsilon: f64, ) -> FloatTensor<Self>

Last-axis RMSNorm with working arithmetic and one final output-storage cast.
Source§

fn rms_norm_with_stats( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, epsilon: f64, ) -> RmsNormOutput<Self>

RMSNorm forward retaining reciprocal row norms for backward.
Source§

fn rms_norm_backward( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, grad: FloatTensor<Self>, rstd: FloatTensor<Self>, ) -> RmsNormBackward<Self>

RMSNorm derivatives from saved reciprocal row norms, without repeating forward.
Source§

fn rms_norm_backward_select( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, grad: FloatTensor<Self>, rstd: FloatTensor<Self>, mask: [bool; 2], ) -> [Option<FloatTensor<Self>>; 2]

RMSNorm input and weight gradients selected by the two corresponding mask entries.
Source§

fn layer_norm_with_stats( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, beta: Option<FloatTensor<Self>>, epsilon: f64, ) -> LayerNormOutput<Self>

Native forward with statistics retained for backward.
Source§

fn layer_norm_backward( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, grad: FloatTensor<Self>, mean: FloatTensor<Self>, rstd: FloatTensor<Self>, ) -> LayerNormBackward<Self>

Native backward using the exact statistics returned by forward.
Source§

fn layer_norm_backward_select( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, grad: FloatTensor<Self>, mean: FloatTensor<Self>, rstd: FloatTensor<Self>, mask: [bool; 3], ) -> [Option<FloatTensor<Self>>; 3]

LayerNorm input, weight and bias gradients selected in that order.
Source§

fn layer_norm_default( tensor: FloatTensor<Self>, gamma: FloatTensor<Self>, beta: Option<FloatTensor<Self>>, epsilon: f64, ) -> FloatTensor<Self>

Differentiable primitive composition for backends without native LayerNorm backward.
Source§

fn ctc_loss( log_probs: FloatTensor<Self>, targets: IntTensor<Self>, input_lengths: IntTensor<Self>, target_lengths: IntTensor<Self>, blank: usize, ) -> FloatTensor<Self>

Computes the Connectionist Temporal Classification (CTC) loss. Read more
Source§

fn ctc_loss_backward( _log_probs: FloatTensor<Self>, _targets: IntTensor<Self>, _input_lengths: IntTensor<Self>, _target_lengths: IntTensor<Self>, _grad_loss: FloatTensor<Self>, _blank: usize, ) -> FloatTensor<Self>

Backward pass for ctc_loss: gradient w.r.t. log_probs. Read more
Source§

fn rfft( signal: FloatTensor<Self>, dim: usize, n: Option<usize>, ) -> (FloatTensor<Self>, FloatTensor<Self>)

Real-valued FFT with optional size parameter. Read more
Source§

fn irfft( spectrum_re: FloatTensor<Self>, spectrum_im: FloatTensor<Self>, dim: usize, n: Option<usize>, ) -> FloatTensor<Self>

Inverse real-valued FFT with optional output size. Read more
Source§

fn avg_pool3d_native_output_size( _input: [usize; 3], _kernel: [usize; 3], _stride: [usize; 3], _padding: [usize; 3], _ceil: bool, ) -> Option<[usize; 3]>

Native volume output geometry, or None to retain the backend’s composed operations.
Source§

fn has_layer_norm_backward() -> bool

Whether native forward statistics and complete first-order backward are available.
Source§

fn has_rms_norm_backward() -> bool

Whether saved RMSNorm statistics and complete first-order backward are available.
Source§

fn has_ctc_loss_backward() -> bool

Returns true if this backend implements ctc_loss_backward natively. Read more
Source§

impl QTensorOps<Dispatch> for Dispatch

Source§

fn q_from_data(data: TensorData, device: &Device<Self>) -> QuantizedTensor<Self>

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

fn quantize( tensor: FloatTensor<Self>, scheme: &QuantScheme, qparams: QuantizationParametersPrimitive<Self>, ) -> QuantizedTensor<Self>

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

fn quantize_dynamic( tensor: FloatTensor<Self>, scheme: &QuantScheme, ) -> QuantizedTensor<Self>

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

fn quantize_dynamic_with_precision( tensor: FloatTensor<Self>, scheme: &QuantScheme, calibration_dtype: FloatDType, ) -> QuantizedTensor<Self>

Explicit calibration arithmetic independent of the original input and packed parameter storage. Quantizes the original input rather than its calibration copy, retaining the selected scheme.
Source§

fn dequantize( tensor: QuantizedTensor<Self>, dtype: FloatDType, ) -> FloatTensor<Self>

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

fn q_device(tensor: &QuantizedTensor<Self>) -> Device<Self>

Gets the device of the tensor. Read more
Source§

fn q_to_device( tensor: QuantizedTensor<Self>, device: &Device<Self>, ) -> QuantizedTensor<Self>

Moves the tensor to the given device. Read more
Source§

fn q_reshape( tensor: QuantizedTensor<Self>, shape: Shape, ) -> QuantizedTensor<Self>

Reshapes a tensor. Read more
Source§

fn q_into_data( tensor: QuantizedTensor<Self>, ) -> impl Future<Output = Result<TensorData, ExecutionError>> + Send

Converts the tensor to a data structure. Read more
Source§

fn q_detach(tensor: QuantizedTensor<Self>) -> QuantizedTensor<Self>

Detaches a tensor from the computation graph.
Source§

fn q_set_require_grad( tensor: QuantizedTensor<Self>, _require_grad: bool, ) -> QuantizedTensor<Self>

Sets the require_grad flag of a tensor.
Source§

fn q_is_require_grad(_tensor: &QuantizedTensor<Self>) -> bool

Returns the require_grad flag of a tensor.
Source§

fn q_is_tracked(tensor: &QuantizedTensor<Self>) -> bool

Graph participation of a differentiable quantized surrogate, if supported.
Source§

fn q_gradient_checkpointing_strategy( _tensor: &QuantizedTensor<Self>, ) -> Option<GradientCheckpointingStrategy>

The checkpointing policy attached to this quantized tensor.
Source§

fn q_autodiff_context(tensor: &QuantizedTensor<Self>) -> AutodiffContext

Runtime autodiff association of quantized storage and its optional surrogate.
Source§

fn q_with_autodiff_context( tensor: QuantizedTensor<Self>, context: AutodiffContext, ) -> QuantizedTensor<Self>

Change runtime association without converting the quantized payload.
Source§

fn q_with_gradient_checkpointing_strategy( _tensor: QuantizedTensor<Self>, _strategy: GradientCheckpointingStrategy, ) -> QuantizedTensor<Self>

Override checkpointing without changing quantized storage or surrogate history.
Source§

fn q_expand( tensor: QuantizedTensor<Self>, shape: Shape, ) -> QuantizedTensor<Self>

Broadcasts the tensor to the given shape.
Source§

fn q_transpose(tensor: QuantizedTensor<Self>) -> QuantizedTensor<Self>

Transposes a tensor. Read more
Source§

fn q_swap_dims( tensor: QuantizedTensor<Self>, dim1: usize, dim2: usize, ) -> QuantizedTensor<Self>

Swaps two dimensions of a tensor. Read more
Source§

fn q_permute( tensor: QuantizedTensor<Self>, axes: &[usize], ) -> QuantizedTensor<Self>

Permutes the dimensions of a tensor. Read more
Source§

fn q_flip( tensor: QuantizedTensor<Self>, axes: &[usize], ) -> QuantizedTensor<Self>

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

fn q_select( tensor: QuantizedTensor<Self>, dim: usize, indices: IntTensor<Self>, ) -> QuantizedTensor<Self>

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

fn q_slice( tensor: QuantizedTensor<Self>, slices: &[Slice], ) -> QuantizedTensor<Self>

Select tensor elements corresponding to the given slices. Read more
Source§

fn q_gather( dim: usize, tensor: QuantizedTensor<Self>, indices: IntTensor<Self>, ) -> QuantizedTensor<Self>

Gather elements from a tensor. Read more
Source§

fn q_repeat_dim( tensor: QuantizedTensor<Self>, dim: usize, times: usize, ) -> QuantizedTensor<Self>

Repeat the tensor along the given dimension. Read more
Source§

fn q_add( lhs: QuantizedTensor<Self>, rhs: QuantizedTensor<Self>, ) -> TensorPrimitive<Self>

Adds two tensors together. Read more
Source§

fn q_add_scalar( lhs: QuantizedTensor<Self>, rhs: Scalar, ) -> TensorPrimitive<Self>

Adds a scalar to a tensor. Read more
Source§

fn q_clamp_min( tensor: QuantizedTensor<Self>, min: Scalar, ) -> TensorPrimitive<Self>

Clamps a tensor under a minimum value. Read more
Source§

fn q_clamp_max( tensor: QuantizedTensor<Self>, max: Scalar, ) -> TensorPrimitive<Self>

Clamps a tensor over a maximum value. Read more
Source§

fn q_clamp( tensor: QuantizedTensor<Self>, min: Scalar, max: Scalar, ) -> TensorPrimitive<Self>

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

fn q_sub( lhs: QuantizedTensor<Self>, rhs: QuantizedTensor<Self>, ) -> TensorPrimitive<Self>

Subtracts two tensors. Read more
Source§

fn q_sub_scalar( lhs: QuantizedTensor<Self>, rhs: Scalar, ) -> TensorPrimitive<Self>

Subtracts a scalar from a tensor. Read more
Source§

fn q_mul( lhs: QuantizedTensor<Self>, rhs: QuantizedTensor<Self>, ) -> TensorPrimitive<Self>

Multiplies two tensors together element-wise.
Source§

fn q_mul_scalar( lhs: QuantizedTensor<Self>, rhs: Scalar, ) -> TensorPrimitive<Self>

Multiplies a tensor by a scalar. Read more
Source§

fn q_div( lhs: QuantizedTensor<Self>, rhs: QuantizedTensor<Self>, ) -> TensorPrimitive<Self>

Divides two tensors element-wise. Read more
Source§

fn q_div_scalar( lhs: QuantizedTensor<Self>, rhs: Scalar, ) -> TensorPrimitive<Self>

Divides a tensor by a scalar. Read more
Source§

fn q_matmul( lhs: TensorPrimitive<Self>, rhs: TensorPrimitive<Self>, ) -> TensorPrimitive<Self>

Multiplies two tensors together using matrix multiplication. Read more
Source§

fn q_matmul_default( lhs: TensorPrimitive<Self>, rhs: TensorPrimitive<Self>, ) -> TensorPrimitive<Self>

Existing dequantized arithmetic and propagation contract for unsupported native combinations.
Source§

fn q_neg(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Negates a tensor element-wise.
Source§

fn q_recip(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Calculates the reciprocals element-wise
Source§

fn q_sum(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Sum of all elements in a tensor. Read more
Source§

fn q_sum_dim(tensor: QuantizedTensor<Self>, dim: usize) -> TensorPrimitive<Self>

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

fn q_prod(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Product of all elements in a tensor. Read more
Source§

fn q_prod_dim( tensor: QuantizedTensor<Self>, dim: usize, ) -> TensorPrimitive<Self>

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

fn q_mean(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Mean of all elements in a tensor. Read more
Source§

fn q_mean_dim( tensor: QuantizedTensor<Self>, dim: usize, ) -> TensorPrimitive<Self>

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

fn q_cumsum(tensor: QuantizedTensor<Self>, dim: usize) -> TensorPrimitive<Self>

Computes the cumulative sum of elements along a dimension. Read more
Source§

fn q_cumprod(tensor: QuantizedTensor<Self>, dim: usize) -> TensorPrimitive<Self>

Computes the cumulative product of elements along a dimension. Read more
Source§

fn q_cummin(tensor: QuantizedTensor<Self>, dim: usize) -> TensorPrimitive<Self>

Computes the cumulative minimum of elements along a dimension. Read more
Source§

fn q_cummax(tensor: QuantizedTensor<Self>, dim: usize) -> TensorPrimitive<Self>

Computes the cumulative maximum of elements along a dimension. Read more
Source§

fn q_exp(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Returns a new tensor with exponential values. Read more
Source§

fn q_log(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

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

fn q_log1p(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

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

fn q_powf( lhs: QuantizedTensor<Self>, rhs: QuantizedTensor<Self>, ) -> TensorPrimitive<Self>

Element-wise power with another tensor. Read more
Source§

fn q_powi( lhs: QuantizedTensor<Self>, rhs: IntTensor<Self>, ) -> TensorPrimitive<Self>

Element-wise power with an IntTensor. Read more
Source§

fn q_powi_scalar( lhs: QuantizedTensor<Self>, rhs: Scalar, ) -> TensorPrimitive<Self>

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

fn q_powf_scalar( tensor: QuantizedTensor<Self>, value: Scalar, ) -> TensorPrimitive<Self>

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

fn q_sqrt(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

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

fn q_abs(tensor: QuantizedTensor<Self>) -> QuantizedTensor<Self>

Returns a new tensor with absolute values. Read more
Source§

fn q_cos(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Returns a new tensor with cosine values. Read more
Source§

fn q_sin(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Returns a new tensor with sine values. Read more
Source§

fn q_tan(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Returns a new tensor with tangent values. Read more
Source§

fn q_cosh(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Returns a new tensor with hyperbolic cosine values. Read more
Source§

fn q_sinh(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Returns a new tensor with hyperbolic sine values. Read more
Source§

fn q_tanh(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

Returns a new tensor with hyperbolic tangent values. Read more
Source§

fn q_erf(tensor: QuantizedTensor<Self>) -> TensorPrimitive<Self>

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

fn q_cat( tensors: Vec<QuantizedTensor<Self>>, dim: usize, ) -> QuantizedTensor<Self>

Concatenates tensors along a dimension. Read more
Source§

fn q_argmax( tensor: QuantizedTensor<Self>, dim: usize, out_dtype: IntDType, ) -> IntTensor<Self>

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

fn q_argtopk( tensor: QuantizedTensor<Self>, dim: usize, k: usize, out_dtype: IntDType, ) -> IntTensor<Self>

Gets the indices of the k maximum elements of a tensor along an axis. If two elements are equals, order them by the lowest indices Read more
Source§

fn q_topk( tensor: QuantizedTensor<Self>, dim: usize, k: usize, ) -> QuantizedTensor<Self>

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

fn q_argmin( tensor: QuantizedTensor<Self>, dim: usize, out_dtype: IntDType, ) -> IntTensor<Self>

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

fn q_max(tensor: QuantizedTensor<Self>) -> QuantizedTensor<Self>

Gets the maximum element of a tensor. Read more
Source§

fn q_max_dim(tensor: QuantizedTensor<Self>, dim: usize) -> QuantizedTensor<Self>

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

fn q_max_dim_with_indices( tensor: QuantizedTensor<Self>, dim: usize, out_dtype: IntDType, ) -> (QuantizedTensor<Self>, IntTensor<Self>)

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

fn q_min(tensor: QuantizedTensor<Self>) -> QuantizedTensor<Self>

Gets the minimum element of a tensor. Read more
Source§

fn q_min_dim(tensor: QuantizedTensor<Self>, dim: usize) -> QuantizedTensor<Self>

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

fn q_min_dim_with_indices( tensor: QuantizedTensor<Self>, dim: usize, out_dtype: IntDType, ) -> (QuantizedTensor<Self>, IntTensor<Self>)

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

fn q_max_abs(tensor: QuantizedTensor<Self>) -> QuantizedTensor<Self>

Gets the maximum element of a tensor. Read more
Source§

fn q_max_abs_dim( tensor: QuantizedTensor<Self>, dim: usize, ) -> QuantizedTensor<Self>

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

fn q_any( tensor: QuantizedTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn q_any_dim( tensor: QuantizedTensor<Self>, dim: usize, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn q_all( tensor: QuantizedTensor<Self>, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn q_all_dim( tensor: QuantizedTensor<Self>, dim: usize, out_dtype: BoolDType, ) -> BoolTensor<Self>

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

fn q_sort( tensor: QuantizedTensor<Self>, dim: usize, descending: bool, ) -> QuantizedTensor<Self>

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

fn q_sort_with_indices( tensor: QuantizedTensor<Self>, dim: usize, descending: bool, out_dtype: IntDType, ) -> (QuantizedTensor<Self>, IntTensor<Self>)

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

fn q_argsort( tensor: QuantizedTensor<Self>, dim: usize, descending: bool, out_dtype: IntDType, ) -> IntTensor<Self>

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

impl TransactionOps<Dispatch> for Dispatch

Source§

fn tr_execute( transaction: TransactionPrimitive<Self>, ) -> impl Future<Output = Result<TransactionPrimitiveData, ExecutionError>> + Send

Executes a transaction and return its data.

Auto Trait Implementations§

Blanket Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.