Skip to main content

Dispatch

Struct Dispatch 

pub struct Dispatch;
Expand description

The main execution backend in Burn.

Dispatch acts as a global backend that can manage multiple underlying backends (e.g., Cpu, Cuda, Wgpu, Metal, etc.). It is responsible for:

  • Dispatching tensor operations to the appropriate backend.
  • Managing cross-backend tensor transfers.

Essentially, Dispatch is the single entry point for executing tensor operations in a backend-agnostic way. It allows Burn to provide a unified, global backend for users while still leveraging multiple specialized backends under the hood.

§Example

ⓘ
use burn::Dispatch;
use burn::DispatchDevice;

// Select the device to execute operations on
let device = DispatchDevice::Cube(cubecl::Device::Cuda(Default::default()));

// Create a tensor using the global backend
let t = Tensor::<Dispatch, 2>::zeros([128, 128], &device);

Implementations§

§

impl Dispatch

pub fn enumerate(type_id: DispatchDeviceId) -> Vec<DispatchDevice>

List all available devices of the specified type id.

Trait Implementations§

§

impl ActivationOps<Dispatch> for Dispatch

§

fn leaky_relu( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, negative_slope: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the LeakyReLU activation function. Read more
§

fn relu( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the ReLU activation function. Read more
§

fn relu_backward( output: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the ReLU activation function backward. Read more
§

fn gelu( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the Gelu activation function. Read more
§

fn prelu( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, alpha: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the PReLu activation function. Read more
§

fn gelu_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the Gelu activation function backward. Read more
§

fn sigmoid( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the Sigmoid activation function. Read more
§

fn sigmoid_backward( output: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the Sigmoid activation function backward. Read more
§

fn hard_sigmoid( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, alpha: Scalar, beta: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the hard Sigmoid activation function. Read more
§

fn softmax( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn log_softmax( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn softmin( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn log_sigmoid( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the LogSigmoid activation function. Read more
§

fn log_sigmoid_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies the LogSigmoid activation function backward. Read more
§

impl AutodiffBackend for Dispatch

Available on crate feature autodiff only.
§

type InnerBackend = Dispatch

The inner backend type.
§

type Gradients = Gradients

Gradients type.
§

fn backward(tensor: DispatchTensor) -> <Dispatch as AutodiffBackend>::Gradients

Backward pass. Read more
§

fn grad( tensor: &DispatchTensor, grads: &<Dispatch as AutodiffBackend>::Gradients, ) -> Option<DispatchTensor>

Returns the gradients of a tensor. Read more
§

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

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

fn grad_replace( tensor: &DispatchTensor, grads: &mut <Dispatch as AutodiffBackend>::Gradients, grad: DispatchTensor, )

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

fn inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
§

fn int_inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
§

fn bool_inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
§

fn q_inner(tensor: DispatchTensor) -> DispatchTensor

Returns the tensor with inner backend type. Read more
§

fn from_inner(tensor: DispatchTensor) -> DispatchTensor

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

fn int_from_inner(tensor: DispatchTensor) -> DispatchTensor

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

fn bool_from_inner(tensor: DispatchTensor) -> DispatchTensor

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

fn q_from_inner(tensor: DispatchTensor) -> DispatchTensor

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

fn set_distributed_params( tensor: DispatchTensor, param_id: ParamId, ) -> DispatchTensor

Mark the tensor as distributed across multiple devices. The gradients will be aggregated during the backward pass. Read more
§

fn distributed_params(tensor: &DispatchTensor) -> Option<DistributedParams>

Returns the distributed parameters if the tensor was marked as distributed.
§

fn is_distributed(tensor: &DispatchTensor) -> bool

Returns true if the tensor was marked as distributed.
§

impl Backend for Dispatch

§

fn name(device: &<Dispatch as BackendTypes>::Device) -> String

Name of the backend.
§

fn seed(device: &<Dispatch as BackendTypes>::Device, seed: u64)

Seeds the backend on the specified device. Read more
§

fn sync( device: &<Dispatch as BackendTypes>::Device, ) -> Result<(), ExecutionError>

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

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

Measure how long the device spends on the work func puts on the calling stream, in device time. Read more
§

fn profile_start( device: &<Dispatch as BackendTypes>::Device, ) -> Result<Option<ProfileToken>, ExecutionError>

Open a profiling window at the calling stream’s current position, to be closed with profile_end from the same stream. Read more
§

fn profile_end( device: &<Dispatch as BackendTypes>::Device, token: ProfileToken, options: ProfileOptions, ) -> Result<ProfileDuration, ExecutionError>

Close the window token at the calling stream’s current position. Read more
§

fn profile_abandon( device: &<Dispatch as BackendTypes>::Device, token: ProfileToken, )

Drop the window token opened without measuring it, for a caller that will never reach profile_end. Read more
§

fn graph_prepare( device: &<Dispatch as BackendTypes>::Device, ) -> Result<(), ExecutionError>

Prepare device for an upcoming graph capture: route allocations into a stable pool so every buffer allocated before graph_stop_capture can be pinned. Call before the warmup run. No-op by default. Read more
§

fn graph_start_capture( device: &<Dispatch as BackendTypes>::Device, ) -> Result<(), ExecutionError>

Begin recording launches on device into a graph (see graph_stop_capture). Errors on backends without hardware graph support, so callers fall back to re-running.
§

fn graph_stop_capture( device: &<Dispatch as BackendTypes>::Device, ) -> Result<DispatchGraph, ExecutionError>

Stop recording and return the captured graph, ready to graph_replay.
§

unsafe fn graph_replay( device: &<Dispatch as BackendTypes>::Device, graph: &DispatchGraph, ) -> Result<(), ExecutionError>

Replay a captured graph — one dispatch re-running the recorded launches against their original buffers. Read more
§

fn dtype_usage( device: &<Dispatch as BackendTypes>::Device, dtype: DType, ) -> EnumSet<DTypeUsage>

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

fn ad_enabled(device: &<Dispatch as BackendTypes>::Device) -> bool

If autodiff is enabled.
§

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

fn memory_persistent_allocations<Output, Input, Func>( device: &<Dispatch as BackendTypes>::Device, input: Input, func: Func, ) -> Output
where Output: Send, Input: Send, Func: Fn(Input) -> Output + Send,

Sets the current allocation mode to persistent.
§

fn memory_cleanup(device: &<Dispatch as BackendTypes>::Device)

Manually triggers a memory cleanup on the given device.
§

fn memory_pool_report( device: &<Dispatch as BackendTypes>::Device, ) -> Option<Vec<SlicedPoolReport>>

The dynamic pools’ measured state, in the order allocations are routed through them. None on a backend that does not report one, or whose stream has failed. Read more
§

fn memory_pool_usage( device: &<Dispatch as BackendTypes>::Device, ) -> Option<MemoryPoolUsage>

The device allocator’s current state. None on a backend that does not report one, or whose stream has failed.
§

fn staging<'a, Iter>(data: Iter, device: &<Dispatch as BackendTypes>::Device)
where Iter: Iterator<Item = &'a mut TensorData>,

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

fn supports_dtype( device: &<Dispatch as BackendTypes>::Device, dtype: DType, ) -> bool

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

fn flush( device: &<Dispatch as BackendTypes>::Device, ) -> Result<(), ExecutionError>

Flush any pending operation of the backend. Read more
§

impl BackendTypes for Dispatch

§

type Device = DispatchDevice

Device type.
§

type FloatTensorPrimitive = DispatchTensor

Tensor primitive to be used for all float operations.
§

type IntTensorPrimitive = DispatchTensor

Tensor primitive to be used for all int operations.
§

type BoolTensorPrimitive = DispatchTensor

Tensor primitive to be used for all bool operations.
§

type QuantizedTensorPrimitive = DispatchTensor

Tensor primitive to be used for all quantized operations.
§

type GraphPrimitive = DispatchGraph

Captured graph primitive returned by Backend::graph_stop_capture and consumed by Backend::graph_replay: a backend-owned recording of a launch sequence that replays as a single dispatch. Read more
§

impl BoolTensorOps<Dispatch> for Dispatch

§

fn bool_empty( shape: Shape, device: &DispatchDevice, dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Creates a new bool tensor. Read more
§

fn bool_zeros( shape: Shape, device: &DispatchDevice, dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Creates a new bool tensor filled false. Read more
§

fn bool_ones( shape: Shape, device: &DispatchDevice, dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Creates a new bool tensor filled true. Read more
§

async fn bool_into_data( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> Result<TensorData, ExecutionError>

Converts the tensor to a data structure. Read more
§

fn bool_from_data( data: TensorData, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Creates a tensor from the data structure. Read more
§

fn bool_into_int( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Converts bool tensor to int tensor. Read more
§

fn bool_into_float( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, out_dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Converts bool tensor to float tensor. Read more
§

fn bool_to_device( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Moves the tensor to the device.
§

fn bool_reshape( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Reshapes the tensor. Read more
§

fn bool_slice( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, slices: &[Slice], ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_slice_assign( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, slices: &[Slice], value: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_mask_where( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, value: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_mask_fill( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, value: Scalar, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

async fn bool_mask_select( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Selects the elements of the tensor where the mask is true, returned as a 1D tensor. Read more
§

fn bool_gather( dim: usize, tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_scatter_or( dim: usize, tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, value: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_equal( lhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, rhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Equates the two tensors. Read more
§

fn bool_equal_elem( lhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_not( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Inverses boolean values. Read more
§

fn bool_and( lhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, rhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_or( lhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, rhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_swap_dims( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, dim1: usize, dim2: usize, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Swaps two dimensions of a bool tensor. Read more
§

fn bool_permute( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn bool_flip( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_expand( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Broadcasts the bool tensor to the given shape.
§

fn bool_unfold( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, dim: usize, size: usize, step: usize, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Unfold windows along a dimension. Read more
§

fn bool_select( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, dim: usize, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_select_or( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, dim: usize, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, value: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_repeat_dim( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, dim: usize, times: usize, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_cat( tensors: Vec<<Dispatch as BackendTypes>::BoolTensorPrimitive>, dim: usize, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Concatenates the tensors along the given dimension. Read more
§

fn bool_not_equal( lhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, rhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Element-wise non-equality comparison. Read more
§

fn bool_not_equal_elem( lhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_xor( lhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, rhs: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Element-wise exclusive or. Read more
§

fn bool_transpose( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Transposes a bool tensor. Read more
§

fn bool_any( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_any_dim( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_all( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn bool_all_dim( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

async fn bool_argwhere( tensor: <Dispatch as BackendTypes>::BoolTensorPrimitive, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

impl BoolVisionOps for Dispatch

§

fn connected_components( img: <Dispatch as BackendTypes>::BoolTensorPrimitive, connectivity: Connectivity, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Computes the connected components labeled image of boolean image with 4 or 8 way connectivity - returns a tensor of the component label of each pixel.

img- The boolean image tensor in the format [batches, height, width]

§

fn connected_components_with_stats( img: <Dispatch as BackendTypes>::BoolTensorPrimitive, connectivity: Connectivity, opts: ConnectedStatsOptions, out_dtype: IntDType, ) -> (<Dispatch as BackendTypes>::IntTensorPrimitive, ConnectedStatsPrimitive<Dispatch>)

Computes the connected components labeled image of boolean image with 4 or 8 way connectivity and collects statistics on each component - returns a tensor of the component label of each pixel, along with stats collected for each component.

img- The boolean image tensor in the format [batches, height, width]

§

fn bool_erode( input: <Dispatch as BackendTypes>::BoolTensorPrimitive, kernel: <Dispatch as BackendTypes>::BoolTensorPrimitive, opts: MorphOptions, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Erodes an input tensor with the specified kernel.

§

fn bool_dilate( input: <Dispatch as BackendTypes>::BoolTensorPrimitive, kernel: <Dispatch as BackendTypes>::BoolTensorPrimitive, opts: MorphOptions, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Dilates an input tensor with the specified kernel.

§

impl Clone for Dispatch

§

fn clone(&self) -> Dispatch

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
§

impl Debug for Dispatch

§

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

Formats the value using the given formatter. Read more
§

impl Default for Dispatch

§

fn default() -> Dispatch

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

impl DistributedOps<Dispatch> for Dispatch

§

fn start_communication_server( devices: &[DispatchDevice], config: DistributedConfig, )

Start the communication server used to orchestrate tensor syncing between devices. Read more
§

fn close_communication_server(device: &DispatchDevice)

Close the communication server used to orchestrate syncing between devices. Read more
§

fn register_sync_parameters( device: &DispatchDevice, sharded_param_ids: Vec<DistributedParams>, )

Register the parameters that will require gradient synchronization for the upcoming backward pass. Read more
§

fn submit_sync_collective(device: &DispatchDevice)

Tell the gradient sync server that this device has submitted all its sync operations and is ready to be synchronized. Read more
§

fn submit_gradient_sync( _tensor: TensorRef<Dispatch>, _distributed_params: DistributedParams, )

Submit a gradient tensor for synchronization across all devices. Read more
§

fn all_reduce( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, op: ReduceOperation, device_ids: Vec<DeviceId>, ) -> CollectiveTensor<Dispatch>

all_reduce operation. Read more
§

fn sync_collective(device: &DispatchDevice)

Sync the collective operations. Read more
§

unsafe fn comm_device(_tensor: &TensorRef<Dispatch>) -> DispatchDevice

Get the device of the tensor reference. Read more
§

unsafe fn float_from_ref( _tensor: &TensorRef<Dispatch>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a clone of the float tensor from the tensor reference. Read more
§

impl FloatTensorOps<Dispatch> for Dispatch

§

fn float_pad( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, padding: &[(usize, usize)], mode: PadMode, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Pads a tensor with one (before, after) pair per dimension.
§

fn float_from_data( data: TensorData, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_random( shape: Shape, distribution: Distribution, device: &DispatchDevice, dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Creates a new tensor with random values. Read more
§

async fn float_into_data( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> Result<TensorData, ExecutionError>

Converts the tensor to a data structure. Read more
§

fn float_to_device( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Moves the tensor to the given device. Read more
§

fn float_into_int( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Converts float tensor to int tensor. Read more
§

fn float_empty( shape: Shape, device: &DispatchDevice, dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_add( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Adds two tensors together. Read more
§

fn float_add_scalar( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Adds a scalar to a tensor. Read more
§

fn float_sub( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Subtracts two tensors. Read more
§

fn float_sub_scalar( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Subtracts a scalar from a tensor. Read more
§

fn float_mul( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Multiplies two tensors together element-wise.
§

fn float_mul_scalar( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Multiplies a tensor by a scalar. Read more
§

fn float_div( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Divides two tensors element-wise. Read more
§

fn float_div_scalar( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Divides a tensor by a scalar. Read more
§

fn float_remainder( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_remainder_scalar( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_matmul( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Multiplies two tensors together using matrix multiplication. Read more
§

fn float_cross( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_recip( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Calculates the reciprocals element-wise
§

fn float_swap_dims( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim1: usize, dim2: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Swaps two dimensions of a tensor. Read more
§

fn float_permute( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn float_flip( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_reshape( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Reshapes a tensor. Read more
§

fn float_gather( dim: usize, tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Gather elements from a tensor. Read more
§

fn float_scatter( dim: usize, tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, value: <Dispatch as BackendTypes>::FloatTensorPrimitive, update: IndexingUpdateOp, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Scatter elements into a tensor using the specified update operation.
§

fn float_scatter_nd( data: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, values: <Dispatch as BackendTypes>::FloatTensorPrimitive, reduction: IndexingUpdateOp, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_gather_nd( data: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_select( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_select_assign( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, value: <Dispatch as BackendTypes>::FloatTensorPrimitive, update: IndexingUpdateOp, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Assign selected elements along a dimension using the specified update operation.
§

fn float_slice( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, slices: &[Slice], ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_slice_assign( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, slices: &[Slice], value: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_mask_where( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, value: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_mask_fill( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, value: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

async fn float_mask_select( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Selects the elements of the tensor where the mask is true, returned as a 1D tensor. Read more
§

fn float_equal( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Equal comparison of two tensors. Read more
§

fn float_equal_elem( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_greater( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Greater than comparison of two tensors. Read more
§

fn float_greater_elem( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_greater_equal( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_greater_equal_elem( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_lower( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Less than comparison of two tensors. Read more
§

fn float_lower_elem( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_lower_equal( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_lower_equal_elem( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_sum( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Sum of all elements in a tensor. Read more
§

fn float_sum_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_sum_dims( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dims: &[usize], ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Sum the tensor along several dimensions at once, keeping each of them with length one. Read more
§

fn float_mean_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_cumsum( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_cumprod( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_cummin( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_cummax( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_cast( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_exp( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with exponential values. Read more
§

fn float_log( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_log1p( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_powf( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Element-wise power with a FloatTensor. Read more
§

fn float_powf_scalar_impl( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, value: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_sqrt( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_abs( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with absolute values. Read more
§

fn float_cos( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with cosine values. Read more
§

fn float_sin( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with sine values. Read more
§

fn float_tan( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with tangent values. Read more
§

fn float_cosh( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_sinh( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_tanh( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_acos( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_acosh( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_asin( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_asinh( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_atan( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_atanh( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_atan2( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_round( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with rounded values. Read more
§

fn float_floor( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with floored values. Read more
§

fn float_ceil( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with ceiled values. Read more
§

fn float_trunc( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with truncated values. Read more
§

fn float_erf( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_argmax( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn float_argtopk( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, k: usize, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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
§

fn float_topk( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, k: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_topk_with_indices( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, k: usize, out_dtype: IntDType, ) -> (<Dispatch as BackendTypes>::FloatTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

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

fn float_argmin( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn float_expand( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Broadcasts the float tensor to the given shape.
§

fn float_unfold( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, size: usize, step: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Unfold windows along a dimension. Read more
§

fn float_detach( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Detaches a tensor from the computation graph.
§

fn float_set_require_grad( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, require_grad: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Sets the require_grad flag of a tensor.
§

fn float_is_require_grad( tensor: &<Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> bool

Returns the require_grad flag of a tensor.
§

fn float_zeros( shape: Shape, device: &DispatchDevice, dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Creates a new tensor with zeros. Read more
§

fn float_ones( shape: Shape, device: &DispatchDevice, dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Creates a new tensor with ones. Read more
§

fn float_full( shape: Shape, fill_value: Scalar, device: &DispatchDevice, dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Creates a tensor filled with given value. Read more
§

fn float_repeat_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, times: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Repeat the tensor along the given dimension. Read more
§

fn float_clamp_min( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, min: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Clamps a tensor under a minimum value. Read more
§

fn float_clamp_max( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, max: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Clamps a tensor over a maximum value. Read more
§

fn float_clamp( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, min: Scalar, max: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_neg( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Negates a tensor element-wise.
§

fn float_transpose( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Transposes a tensor. Read more
§

fn float_not_equal( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Element-wise non-equality comparison. Read more
§

fn float_not_equal_elem( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_prod( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Product of all elements in a tensor. Read more
§

fn float_prod_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_mean( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Mean of all elements in a tensor. Read more
§

fn float_powi( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Element-wise power with an IntTensor. Read more
§

fn float_powi_scalar_impl( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_powf_scalar( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, value: Scalar, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_cat( tensors: Vec<<Dispatch as BackendTypes>::FloatTensorPrimitive>, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Concatenates tensors along a dimension. Read more
§

fn float_max( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Gets the maximum element of a tensor. Read more
§

fn float_max_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_max_dim_with_indices( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, indices_dtype: IntDType, ) -> (<Dispatch as BackendTypes>::FloatTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

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

fn float_min( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Gets the minimum element of a tensor. Read more
§

fn float_min_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_min_dim_with_indices( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, indices_dtype: IntDType, ) -> (<Dispatch as BackendTypes>::FloatTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

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

fn float_max_abs( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_max_abs_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_any( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_any_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_all( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_all_dim( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_sign( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns the signs of the float tensor. Read more
§

fn float_sort( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, descending: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_sort_with_indices( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, descending: bool, indices_dtype: IntDType, ) -> (<Dispatch as BackendTypes>::FloatTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

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

fn float_argsort( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, descending: bool, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn float_grid_sample_2d( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, grid: <Dispatch as BackendTypes>::FloatTensorPrimitive, options: GridSampleOptions, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn float_is_nan( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_is_inf( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn float_hypot( lhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, rhs: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Returns a new tensor with the Euclidean distance values. Read more
§

fn float_powi_scalar( lhs: <B as BackendTypes>::FloatTensorPrimitive, rhs: Scalar, ) -> <B as BackendTypes>::FloatTensorPrimitive

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

impl FloatVisionOps for Dispatch

§

fn float_erode( input: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel: <Dispatch as BackendTypes>::BoolTensorPrimitive, opts: MorphOptions, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Erodes an input tensor with the specified kernel.

§

fn float_dilate( input: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel: <Dispatch as BackendTypes>::BoolTensorPrimitive, opts: MorphOptions, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Dilates an input tensor with the specified kernel.

§

fn nms( boxes: <Dispatch as BackendTypes>::FloatTensorPrimitive, scores: <Dispatch as BackendTypes>::FloatTensorPrimitive, options: NmsOptions, out_dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Perform Non-Maximum Suppression on bounding boxes.

Returns indices of kept boxes after suppressing overlapping detections. Boxes are processed in descending score order; a box suppresses all lower-scoring boxes with IoU > threshold.

§Arguments
  • boxes - Bounding boxes as [N, 4] tensor in (x1, y1, x2, y2) format
  • scores - Confidence scores as [N] tensor
  • options - NMS options (IoU threshold, score threshold, max boxes)
§Returns

Indices of kept boxes as [M] tensor where M <= N

§

impl IntTensorOps<Dispatch> for Dispatch

§

fn int_pad( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, padding: &[(usize, usize)], mode: PadMode, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Pads a tensor with one (before, after) pair per dimension.
§

fn int_empty( shape: Shape, device: &DispatchDevice, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Creates a new int tensor. Read more
§

async fn int_into_data( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> Result<TensorData, ExecutionError>

Converts the tensor to a data structure. Read more
§

fn int_from_data( data: TensorData, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Creates a tensor from the data structure. Read more
§

fn int_to_device( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Moves the tensor to the given device.
§

fn int_reshape( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Reshapes the tensor. Read more
§

fn int_slice( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, slices: &[Slice], ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Gets the element at the given indices. Read more
§

fn int_slice_assign( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, slices: &[Slice], value: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_into_float( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Converts int tensor to float tensor. Read more
§

fn int_mask_where( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, value: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_mask_fill( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, value: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

async fn int_mask_select( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, mask: <Dispatch as BackendTypes>::BoolTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Selects the elements of the tensor where the mask is true, returned as a 1D tensor. Read more
§

fn int_gather( dim: usize, tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_scatter( dim: usize, tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, value: <Dispatch as BackendTypes>::IntTensorPrimitive, update: IndexingUpdateOp, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Scatter elements into a tensor using the specified update operation.
§

fn int_scatter_nd( data: <Dispatch as BackendTypes>::IntTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, values: <Dispatch as BackendTypes>::IntTensorPrimitive, reduction: IndexingUpdateOp, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Multi-dimensional scatter for int tensors.
§

fn int_gather_nd( data: <Dispatch as BackendTypes>::IntTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Multi-dimensional gather for int tensors.
§

fn int_select( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_select_assign( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, value: <Dispatch as BackendTypes>::IntTensorPrimitive, update: IndexingUpdateOp, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Assign selected elements along a dimension using the specified update operation.
§

fn int_equal( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Element-wise equality comparison. Read more
§

fn int_equal_elem( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_greater( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Element-wise greater than comparison. Read more
§

fn int_greater_elem( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_greater_equal( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_greater_equal_elem( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_lower( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Element-wise less than comparison. Read more
§

fn int_lower_elem( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_lower_equal( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_lower_equal_elem( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_add( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise addition. Read more
§

fn int_add_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise addition with a scalar. Read more
§

fn int_sub( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise subtraction. Read more
§

fn int_sub_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise subtraction with a scalar. Read more
§

fn int_mul( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise multiplication. Read more
§

fn int_mul_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise multiplication with a scalar. Read more
§

fn int_div( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise division. Read more
§

fn int_div_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise division with a scalar. Read more
§

fn int_remainder( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise floor modulo. Read more
§

fn int_remainder_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise floor modulo with a scalar. Read more
§

fn int_matmul( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Multiplies two tensors together using matrix multiplication. Read more
§

fn int_sum( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Sums all elements in the tensor. Read more
§

fn int_sum_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_prod( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_prod_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_mean_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_cumsum( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_cumprod( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_cummin( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_cummax( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_argmax( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_argtopk( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, k: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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
§

fn int_topk( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, k: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_topk_with_indices( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, k: usize, ) -> (<Dispatch as BackendTypes>::IntTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

Gets the values of the k maximum elements along a dimension, and their indices. Read more
§

fn int_argmin( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_abs( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Returns a new tensor with absolute values. Read more
§

fn int_swap_dims( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim1: usize, dim2: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Swaps two dimensions of an int tensor. Read more
§

fn int_permute( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn int_flip( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_random( shape: Shape, distribution: Distribution, device: &DispatchDevice, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_expand( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Broadcasts the int tensor to the given shape.
§

fn bitwise_and( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise AND operation for Int Tensors
§

fn bitwise_and_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise AND operation for Int Tensors with a scalar
§

fn bitwise_or( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise OR operation for Int Tensors
§

fn bitwise_or_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise OR operation for Int Tensors with a scalar
§

fn bitwise_xor( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise XOR operation for Int Tensors
§

fn bitwise_xor_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise XOR operation for Int Tensors with a scalar
§

fn bitwise_not( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise NOT operation for Int Tensors
§

fn bitwise_left_shift( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise left shift operation for Int Tensors
§

fn bitwise_left_shift_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise left shift operation for Int Tensors with a scalar
§

fn bitwise_right_shift( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise right shift operation for Int Tensors
§

fn bitwise_right_shift_scalar( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Bitwise right shift operation for Int Tensors with a scalar
§

fn int_cast( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_unfold( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, size: usize, step: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Unfold windows along a dimension. Read more
§

fn int_repeat_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, times: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_cat( tensors: Vec<<Dispatch as BackendTypes>::IntTensorPrimitive>, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_not_equal( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

Element-wise non-equality comparison. Read more
§

fn int_not_equal_elem( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_powi( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise power with a IntTensor. Read more
§

fn int_powi_scalar_impl( lhs: <Dispatch as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise power with a scalar. Read more
§

fn int_clamp_min( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, min: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Clamps a tensor under a minimum value. Read more
§

fn int_clamp_max( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, max: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Clamps a tensor over a maximum value. Read more
§

fn int_clamp( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, min: Scalar, max: Scalar, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_neg( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Element-wise negation. Read more
§

fn int_zeros( shape: Shape, device: &DispatchDevice, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Creates a tensor of zeros. Read more
§

fn int_ones( shape: Shape, device: &DispatchDevice, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Creates a tensor of ones. Read more
§

fn int_full( shape: Shape, fill_value: Scalar, device: &DispatchDevice, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Creates a tensor filled with given value. Read more
§

fn int_mean( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_max( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Gets the maximum element in the tensor. Read more
§

fn int_max_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_max_dim_with_indices( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> (<Dispatch as BackendTypes>::IntTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

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

fn int_max_abs( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_max_abs_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_min( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Gets the minimum element in the tensor. Read more
§

fn int_min_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_min_dim_with_indices( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, ) -> (<Dispatch as BackendTypes>::IntTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

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

fn int_transpose( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Transposes an int tensor. Read more
§

fn int_arange_step( range: Range<i64>, step: usize, device: &DispatchDevice, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_arange( range: Range<i64>, device: &DispatchDevice, dtype: IntDType, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_any( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_any_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_all( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_all_dim( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, out_dtype: BoolStore, ) -> <Dispatch as BackendTypes>::BoolTensorPrimitive

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

fn int_sign( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Returns the signs of the int tensor. Read more
§

fn int_sort( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_sort_with_indices( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, descending: bool, ) -> (<Dispatch as BackendTypes>::IntTensorPrimitive, <Dispatch as BackendTypes>::IntTensorPrimitive)

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

fn int_argsort( tensor: <Dispatch as BackendTypes>::IntTensorPrimitive, dim: usize, descending: bool, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

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

fn int_square( tensor: <B as BackendTypes>::IntTensorPrimitive, ) -> <B as BackendTypes>::IntTensorPrimitive

Element-wise square with a IntTensor. Read more
§

fn int_powi_scalar( lhs: <B as BackendTypes>::IntTensorPrimitive, rhs: Scalar, ) -> <B as BackendTypes>::IntTensorPrimitive

Element-wise power with a scalar. Read more
§

impl IntVisionOps for Dispatch

§

fn int_erode( input: <Dispatch as BackendTypes>::IntTensorPrimitive, kernel: <Dispatch as BackendTypes>::BoolTensorPrimitive, opts: MorphOptions, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Erodes an input tensor with the specified kernel.

§

fn int_dilate( input: <Dispatch as BackendTypes>::IntTensorPrimitive, kernel: <Dispatch as BackendTypes>::BoolTensorPrimitive, opts: MorphOptions, ) -> <Dispatch as BackendTypes>::IntTensorPrimitive

Dilates an input tensor with the specified kernel.

§

impl LinalgOps for Dispatch

§

fn svd( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, sweeps: usize, swap: bool, ) -> (<Dispatch as BackendTypes>::FloatTensorPrimitive, <Dispatch as BackendTypes>::FloatTensorPrimitive, <Dispatch as BackendTypes>::FloatTensorPrimitive)

Computes a reduced singular value decomposition.

§

impl ModuleOps<Dispatch> for Dispatch

§

fn batch_norm( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, gamma: <Dispatch as BackendTypes>::FloatTensorPrimitive, beta: <Dispatch as BackendTypes>::FloatTensorPrimitive, mean: <Dispatch as BackendTypes>::FloatTensorPrimitive, variance: <Dispatch as BackendTypes>::FloatTensorPrimitive, epsilon: f64, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Applies batch normalization using explicitly supplied channel statistics. Read more
§

fn batch_norm_train( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, gamma: <Dispatch as BackendTypes>::FloatTensorPrimitive, beta: <Dispatch as BackendTypes>::FloatTensorPrimitive, epsilon: f64, ) -> BatchNormTrain<Dispatch>

Applies batch normalization with the statistics of the batch itself, and returns them. Read more
§

fn batch_norm_train_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, gamma: <Dispatch as BackendTypes>::FloatTensorPrimitive, mean: <Dispatch as BackendTypes>::FloatTensorPrimitive, variance: <Dispatch as BackendTypes>::FloatTensorPrimitive, epsilon: f64, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> BatchNormTrainBackward<Dispatch>

Gradients of batch_norm_train with respect to its input, gamma and beta, given the gradient of its output. mean and variance are the statistics it returned.
§

fn conv2d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: ConvOptions<2>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Two dimensional convolution. Read more
§

fn deform_conv2d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, offset: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, mask: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: DeformConvOptions<2>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Two dimensional deformable convolution. Read more
§

fn deform_conv2d_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, offset: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, mask: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, options: DeformConvOptions<2>, ) -> DeformConv2dBackward<Dispatch>

Backward pass for the deform_conv2d operation.
§

fn conv3d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: ConvOptions<3>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Three dimensional convolution. Read more
§

fn conv_transpose2d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: ConvTransposeOptions<2>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Two dimensional transposed convolution. Read more
§

fn conv_transpose3d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: ConvTransposeOptions<3>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Three dimensional transposed convolution. Read more
§

fn avg_pool2d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ceil_mode: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Two dimensional avg pooling. Read more
§

fn avg_pool2d_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ceil_mode: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Backward pass for the avg pooling 2d operation.
§

fn adaptive_avg_pool2d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_size: [usize; 2], ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Two dimensional adaptive avg pooling. Read more
§

fn adaptive_avg_pool2d_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn adaptive_avg_pool3d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_size: [usize; 3], ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Three dimensional adaptive avg pooling. Read more
§

fn adaptive_avg_pool3d_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn max_pool2d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ceil_mode: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Two dimensional max pooling. Read more
§

fn max_pool2d_with_indices( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ceil_mode: bool, indices_dtype: IntDType, ) -> MaxPool2dWithIndices<Dispatch>

Two dimensional max pooling with indices. Read more
§

fn max_pool2d_with_indices_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ceil_mode: bool, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> MaxPool2dBackward<Dispatch>

Backward pass for the max pooling 2d operation.
§

fn interpolate( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_size: [usize; 2], options: InterpolateOptions, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Down/up samples the input. Read more
§

fn interpolate_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_size: [usize; 2], options: InterpolateOptions, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Backward pass for the interpolate operation.
§

fn embedding( weights: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Embedding operation. Read more
§

fn embedding_backward( weights: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Embedding backward operation. Read more
§

fn conv1d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: ConvOptions<1>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

One dimensional convolution. Read more
§

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

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

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

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

fn conv1d_bias_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

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

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

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

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

fn conv2d_bias_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

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

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

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

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

fn conv3d_bias_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn conv_transpose1d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, weight: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: ConvTransposeOptions<1>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

One dimensional transposed convolution. Read more
§

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

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

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

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

fn conv_transpose1d_bias_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

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

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

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

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

fn conv_transpose2d_bias_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

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

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

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

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

fn conv_transpose3d_bias_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, bias: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

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

Four-dimensional unfolding. Read more
§

fn avg_pool1d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ceil_mode: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

One dimensional avg pooling. Read more
§

fn avg_pool1d_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ceil_mode: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Backward pass for the avg pooling 1d operation.
§

fn adaptive_avg_pool1d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, output_size: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

One dimensional adaptive avg pooling. Read more
§

fn adaptive_avg_pool1d_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn max_pool1d( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ceil_mode: bool, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

One dimensional max pooling. Read more
§

fn max_pool1d_with_indices( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ceil_mode: bool, indices_dtype: IntDType, ) -> MaxPool1dWithIndices<Dispatch>

One dimensional max pooling with indices. Read more
§

fn max_pool1d_with_indices_backward( x: <Dispatch as BackendTypes>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ceil_mode: bool, output_grad: <Dispatch as BackendTypes>::FloatTensorPrimitive, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> MaxPool1dBackward<Dispatch>

Backward pass for the max pooling 1d operation.
§

fn attention( query: <Dispatch as BackendTypes>::FloatTensorPrimitive, key: <Dispatch as BackendTypes>::FloatTensorPrimitive, value: <Dispatch as BackendTypes>::FloatTensorPrimitive, mask: Option<<Dispatch as BackendTypes>::BoolTensorPrimitive>, attn_bias: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, options: AttentionModuleOptions, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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
§

fn layer_norm( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, gamma: <Dispatch as BackendTypes>::FloatTensorPrimitive, beta: Option<<Dispatch as BackendTypes>::FloatTensorPrimitive>, epsilon: f64, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn has_ctc_loss_backward() -> bool

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

fn ctc_loss( log_probs: <Dispatch as BackendTypes>::FloatTensorPrimitive, targets: <Dispatch as BackendTypes>::IntTensorPrimitive, input_lengths: <Dispatch as BackendTypes>::IntTensorPrimitive, target_lengths: <Dispatch as BackendTypes>::IntTensorPrimitive, blank: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn ctc_loss_backward( log_probs: <Dispatch as BackendTypes>::FloatTensorPrimitive, targets: <Dispatch as BackendTypes>::IntTensorPrimitive, input_lengths: <Dispatch as BackendTypes>::IntTensorPrimitive, target_lengths: <Dispatch as BackendTypes>::IntTensorPrimitive, grad_loss: <Dispatch as BackendTypes>::FloatTensorPrimitive, blank: usize, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn linear( x: <B as BackendTypes>::FloatTensorPrimitive, weight: <B as BackendTypes>::FloatTensorPrimitive, bias: Option<<B as BackendTypes>::FloatTensorPrimitive>, ) -> <B as BackendTypes>::FloatTensorPrimitive

Linear transformation. Read more
§

fn linear_x_backward( weight: <B as BackendTypes>::FloatTensorPrimitive, output_grad: <B as BackendTypes>::FloatTensorPrimitive, ) -> <B as BackendTypes>::FloatTensorPrimitive

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

fn linear_weight_backward( x: <B as BackendTypes>::FloatTensorPrimitive, output_grad: <B as BackendTypes>::FloatTensorPrimitive, ) -> <B as BackendTypes>::FloatTensorPrimitive

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

fn linear_bias_backward( output_grad: <B as BackendTypes>::FloatTensorPrimitive, ) -> <B as BackendTypes>::FloatTensorPrimitive

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

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

Four dimensional fold (col2im), the adjoint of unfold4d. Read more
§

impl QTensorOps<Dispatch> for Dispatch

§

fn q_from_data( data: TensorData, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

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

fn quantize( tensor: <Dispatch as BackendTypes>::FloatTensorPrimitive, scheme: &QuantScheme, qparams: QuantizationParametersPrimitive<Dispatch>, ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

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

fn dequantize( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, dtype: FloatDType, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

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

fn q_to_device( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, device: &DispatchDevice, ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

Moves the tensor to the given device. Read more
§

fn q_reshape( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

Reshapes a tensor. Read more
§

async fn q_into_data( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, ) -> Result<TensorData, ExecutionError>

Converts the tensor to a data structure. Read more
§

fn q_expand( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, shape: Shape, ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

Broadcasts the tensor to the given shape.
§

fn q_swap_dims( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, dim1: usize, dim2: usize, ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

Swaps two dimensions of a tensor. Read more
§

fn q_permute( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

Permutes the dimensions of a tensor. Read more
§

fn q_flip( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, axes: &[usize], ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

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

fn q_select( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, dim: usize, indices: <Dispatch as BackendTypes>::IntTensorPrimitive, ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

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

fn q_slice( tensor: <Dispatch as BackendTypes>::QuantizedTensorPrimitive, slices: &[Slice], ) -> <Dispatch as BackendTypes>::QuantizedTensorPrimitive

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

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

Multiplies two tensors together using matrix multiplication. Read more
§

fn quantize_dynamic( tensor: <B as BackendTypes>::FloatTensorPrimitive, scheme: &QuantScheme, ) -> <B as BackendTypes>::QuantizedTensorPrimitive

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

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

Detaches a tensor from the computation graph.
§

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

Sets the require_grad flag of a tensor.
§

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

Returns the require_grad flag of a tensor.
§

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

Transposes a tensor. Read more
§

fn q_gather( dim: usize, tensor: <B as BackendTypes>::QuantizedTensorPrimitive, indices: <B as BackendTypes>::IntTensorPrimitive, ) -> <B as BackendTypes>::QuantizedTensorPrimitive

Gather elements from a tensor. Read more
§

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

Repeat the tensor along the given dimension. Read more
§

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

Adds two tensors together. Read more
§

fn q_add_scalar( lhs: <B as BackendTypes>::QuantizedTensorPrimitive, rhs: Scalar, ) -> TensorPrimitive<B>

Adds a scalar to a tensor. Read more
§

fn q_clamp_min( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, min: Scalar, ) -> TensorPrimitive<B>

Clamps a tensor under a minimum value. Read more
§

fn q_clamp_max( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, max: Scalar, ) -> TensorPrimitive<B>

Clamps a tensor over a maximum value. Read more
§

fn q_clamp( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, min: Scalar, max: Scalar, ) -> TensorPrimitive<B>

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

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

Subtracts two tensors. Read more
§

fn q_sub_scalar( lhs: <B as BackendTypes>::QuantizedTensorPrimitive, rhs: Scalar, ) -> TensorPrimitive<B>

Subtracts a scalar from a tensor. Read more
§

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

Multiplies two tensors together element-wise.
§

fn q_mul_scalar( lhs: <B as BackendTypes>::QuantizedTensorPrimitive, rhs: Scalar, ) -> TensorPrimitive<B>

Multiplies a tensor by a scalar. Read more
§

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

Divides two tensors element-wise. Read more
§

fn q_div_scalar( lhs: <B as BackendTypes>::QuantizedTensorPrimitive, rhs: Scalar, ) -> TensorPrimitive<B>

Divides a tensor by a scalar. Read more
§

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

Negates a tensor element-wise.
§

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

Calculates the reciprocals element-wise
§

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

Sum of all elements in a tensor. Read more
§

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

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

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

Product of all elements in a tensor. Read more
§

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

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

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

Mean of all elements in a tensor. Read more
§

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

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

fn q_cumsum( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>

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

fn q_cumprod( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>

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

fn q_cummin( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>

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

fn q_cummax( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, ) -> TensorPrimitive<B>

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

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

Returns a new tensor with exponential values. Read more
§

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

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

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

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

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

Element-wise power with another tensor. Read more
§

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

Element-wise power with an IntTensor. Read more
§

fn q_powi_scalar( lhs: <B as BackendTypes>::QuantizedTensorPrimitive, rhs: Scalar, ) -> TensorPrimitive<B>

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

fn q_powf_scalar( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, value: Scalar, ) -> TensorPrimitive<B>

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

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

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

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

Returns a new tensor with absolute values. Read more
§

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

Returns a new tensor with cosine values. Read more
§

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

Returns a new tensor with sine values. Read more
§

fn q_tan( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>

Returns a new tensor with tangent values. Read more
§

fn q_cosh( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>

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

fn q_sinh( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, ) -> TensorPrimitive<B>

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

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

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

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

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

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

Concatenates tensors along a dimension. Read more
§

fn q_argmax( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, out_dtype: IntDType, ) -> <B as BackendTypes>::IntTensorPrimitive

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

fn q_argtopk( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, k: usize, out_dtype: IntDType, ) -> <B as BackendTypes>::IntTensorPrimitive

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
§

fn q_topk( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, k: usize, ) -> <B as BackendTypes>::QuantizedTensorPrimitive

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

fn q_topk_with_indices( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, k: usize, out_dtype: IntDType, ) -> (<B as BackendTypes>::QuantizedTensorPrimitive, <B as BackendTypes>::IntTensorPrimitive)

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

fn q_argmin( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, out_dtype: IntDType, ) -> <B as BackendTypes>::IntTensorPrimitive

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

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

Gets the maximum element of a tensor. Read more
§

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

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

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

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

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

Gets the minimum element of a tensor. Read more
§

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

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

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

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

fn q_max_abs( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, ) -> <B as BackendTypes>::QuantizedTensorPrimitive

Gets the maximum element of a tensor. Read more
§

fn q_max_abs_dim( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, ) -> <B as BackendTypes>::QuantizedTensorPrimitive

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

fn q_any( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, out_dtype: BoolStore, ) -> <B as BackendTypes>::BoolTensorPrimitive

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

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

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

fn q_all( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, out_dtype: BoolStore, ) -> <B as BackendTypes>::BoolTensorPrimitive

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

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

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

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

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

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

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

fn q_argsort( tensor: <B as BackendTypes>::QuantizedTensorPrimitive, dim: usize, descending: bool, out_dtype: IntDType, ) -> <B as BackendTypes>::IntTensorPrimitive

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

impl SignalOps for Dispatch

§

fn rfft( signal: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, n: Option<usize>, ) -> (<Dispatch as BackendTypes>::FloatTensorPrimitive, <Dispatch as BackendTypes>::FloatTensorPrimitive)

Real FFT along dim, truncating or padding to n when supplied. Returns the real and imaginary components of the one-sided spectrum.

§

fn irfft( real: <Dispatch as BackendTypes>::FloatTensorPrimitive, imag: <Dispatch as BackendTypes>::FloatTensorPrimitive, dim: usize, n: Option<usize>, ) -> <Dispatch as BackendTypes>::FloatTensorPrimitive

Inverse real FFT along dim, with optional output length n.

§

impl TransactionOps<Dispatch> for Dispatch

§

impl VisionBackend for Dispatch

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Adaptor<()> for T

§

fn adapt(&self)

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

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

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
§

impl<K, Q> Comparable<Q> for K
where K: Borrow<Q> + ?Sized, Q: Ord + ?Sized,

§

fn compare(&self, key: &Q) -> Ordering

Compare self to key and return their ordering.
§

impl<K, Q> Equivalent<Q> for K
where K: Borrow<Q> + ?Sized, Q: Eq + ?Sized,

§

fn equivalent(&self, key: &Q) -> bool

Compare self to key and return true if they are equal.
§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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

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

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

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

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

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

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

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

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

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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