burn::backend::wgpu

Type Alias Wgpu

pub type Wgpu<F = f32, I = i32, B = u32, C = WgslCompiler> = Fusion<JitBackend<WgpuRuntime<C>, F, I, B>>;
Expand description

Tensor backend that uses the wgpu crate for executing GPU compute shaders.

This backend can target multiple graphics APIs, including:

  • Vulkan on Linux, Windows, and Android.
  • OpenGL on Linux, Windows, and Android.
  • DirectX 12 on Windows.
  • Metal on Apple hardware.
  • WebGPU on supported browsers and wasm runtimes.

To configure the wgpu backend, eg. to select what graphics API to use or what memory strategy to use, you have to manually initialize the runtime. For example:

fn custom_init() {
    let device = Default::default();
    burn::backend::wgpu::init_sync::<burn::backend::wgpu::Vulkan>(
        &device,
        Default::default(),
    );
}

will mean the given device (in this case the default) will be initialized to use Vulkan as the graphics API. It’s also possible to use an existing wgpu device, by using init_existing_device.

§Notes

This version of the wgpu backend uses [burn_fusion] to compile and optimize streams of tensor operations for improved performance.

You can disable the fusion feature flag to remove that functionality, which might be necessary on wasm for now.

Aliased Type§

struct Wgpu<F = f32, I = i32, B = u32, C = WgslCompiler> { /* private fields */ }

Trait Implementations

§

impl<B> ActivationOps<Fusion<B>> for Fusion<B>
where B: FusionBackend,

§

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

Applies the LeakyReLU activation function. Read more
§

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

Applies the ReLU activation function. Read more
§

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

Applies the ReLU activation function backward. Read more
§

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

Applies the Gelu activation function. Read more
§

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

Applies the PReLu activation function. Read more
§

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

Applies the Gelu activation function backward. Read more
§

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

Applies the Sigmoid activation function. Read more
§

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

Applies the Sigmoid activation function backward. Read more
§

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

Applies the hard Sigmoid activation function. Read more
§

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

Applies the LogSigmoid activation function. Read more
§

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

Applies the LogSigmoid activation function backward. Read more
§

impl<B> Backend for Fusion<B>
where B: FusionBackend,

§

type Device = <B as Backend>::Device

Device type.
§

type FloatTensorPrimitive = FusionTensor<<B as FusionBackend>::FusionRuntime>

Tensor primitive to be used for all float operations.
§

type FloatElem = <B as Backend>::FloatElem

Default float element type.
§

type IntTensorPrimitive = FusionTensor<<B as FusionBackend>::FusionRuntime>

Tensor primitive to be used for all int operations.
§

type IntElem = <B as Backend>::IntElem

Int element type.
§

type BoolTensorPrimitive = FusionTensor<<B as FusionBackend>::FusionRuntime>

Tensor primitive to be used for all bool operations.
§

type BoolElem = <B as Backend>::BoolElem

Tensor primitive to be used for all bool operations.
§

type QuantizedTensorPrimitive = FusionTensor<<B as FusionBackend>::FusionRuntime>

Tensor primitive to be used for all quantized operations.
§

type QuantizedEncoding = <B as Backend>::QuantizedEncoding

Quantized tensor encoding type.
§

fn name() -> String

Name of the backend.
§

fn seed(seed: u64)

Seed the backend.
§

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

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

fn ad_enabled() -> bool

If autodiff is enabled.
§

impl<B> BoolTensorOps<Fusion<B>> for Fusion<B>
where B: FusionBackend,

§

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

Creates a new bool tensor. Read more
§

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

Converts the tensor to a data structure. Read more
§

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

Creates a tensor from the data structure. Read more
§

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

Converts bool tensor to int tensor. Read more
§

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

Converts bool tensor to float tensor. Read more
§

fn bool_device( tensor: &<Fusion<B> as Backend>::BoolTensorPrimitive, ) -> <Fusion<B> as Backend>::Device

Gets the device of the tensor. Read more
§

fn bool_to_device( tensor: <Fusion<B> as Backend>::BoolTensorPrimitive, device: &<Fusion<B> as Backend>::Device, ) -> <Fusion<B> as Backend>::BoolTensorPrimitive

Moves the tensor to the device.
§

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

Reshapes the tensor. Read more
§

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

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

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

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

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

Concatenates the tensors along the given dimension. Read more
§

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

Equates the two tensors. Read more
§

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

Inverses boolean values. Read more
§

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

Swaps two dimensions of a bool tensor. Read more
§

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

Permutes the dimensions of a tensor. Read more
§

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

Broadcasts the bool tensor to the given shape.
§

fn bool_flip( tensor: <Fusion<B> as Backend>::BoolTensorPrimitive, axes: &[usize], ) -> <Fusion<B> as Backend>::BoolTensorPrimitive

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

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

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

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

Element-wise non-equality comparison. Read more
§

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

Transposes a bool tensor. Read more
§

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

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

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

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

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

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

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

Split the tensor along the given dimension into chunks with sizes in dim according to split_sizes. Read more
§

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

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

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

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

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

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

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

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

fn bool_argwhere( tensor: <B as Backend>::BoolTensorPrimitive, ) -> impl Future<Output = <B as Backend>::IntTensorPrimitive> + Send + 'static

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

fn bool_nonzero( tensor: <B as Backend>::BoolTensorPrimitive, ) -> impl Future<Output = Vec<<B as Backend>::IntTensorPrimitive>> + Send + 'static

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

impl<B> Clone for Fusion<B>
where B: Clone + FusionBackend,

§

fn clone(&self) -> Fusion<B>

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

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

Performs copy-assignment from source. Read more
§

impl<B> Debug for Fusion<B>
where B: Debug + FusionBackend,

§

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

Formats the value using the given formatter. Read more
§

impl<B> Default for Fusion<B>
where B: Default + FusionBackend,

§

fn default() -> Fusion<B>

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

impl<B> FloatTensorOps<Fusion<B>> for Fusion<B>
where B: FusionBackend,

§

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

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

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

Creates a new tensor with random values. Read more
§

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

Creates a new tensor with zeros. Read more
§

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

Creates a new tensor with ones. Read more
§

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

Creates a tensor filled with given value. Read more
§

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

Converts the tensor to a data structure. Read more
§

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

Gets the device of the tensor. Read more
§

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

Moves the tensor to the given device. Read more
§

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

Converts float tensor to int tensor. Read more
§

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

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

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

Adds two tensors together. Read more
§

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

Adds a scalar to a tensor. Read more
§

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

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

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

Subtracts two tensors. Read more
§

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

Subtracts a scalar from a tensor. Read more
§

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

Multiplies two tensors together element-wise.
§

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

Multiplies a tensor by a scalar. Read more
§

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

Divides two tensors element-wise. Read more
§

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

Divides a tensor by a scalar. Read more
§

fn float_remainder( lhs: <Fusion<B> as Backend>::FloatTensorPrimitive, rhs: <Fusion<B> as Backend>::FloatTensorPrimitive, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

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

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

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

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

Multiplies two tensors together using matrix multiplication. Read more
§

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

Swaps two dimensions of a tensor. Read more
§

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

Reshapes a tensor. Read more
§

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

Gather elements from a tensor. Read more
§

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

Scatter elements into a tensor. Read more
§

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

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

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

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

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

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

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

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

fn float_mask_where( tensor: <Fusion<B> as Backend>::FloatTensorPrimitive, mask: <Fusion<B> as Backend>::BoolTensorPrimitive, value: <Fusion<B> as Backend>::FloatTensorPrimitive, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

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

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

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

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

Equal comparison of two tensors. Read more
§

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

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

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

Greater than comparison of two tensors. Read more
§

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

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

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

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

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

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

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

Less than comparison of two tensors. Read more
§

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

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

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

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

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

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

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

Sum of all elements in a tensor. Read more
§

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

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

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

Product of all elements in a tensor. Read more
§

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

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

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

Mean of all elements in a tensor. Read more
§

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

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

fn float_exp( lhs: <Fusion<B> as Backend>::FloatTensorPrimitive, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Returns a new tensor with exponential values. Read more
§

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

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

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

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

fn float_powf_scalar( lhs: <Fusion<B> as Backend>::FloatTensorPrimitive, rhs: f32, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

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

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

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

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

Returns a new tensor with absolute values. Read more
§

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

Returns a new tensor with cosine values. Read more
§

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

Returns a new tensor with sine values. Read more
§

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

Returns a new tensor with tangent values. Read more
§

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

Calculates the reciprocals element-wise
§

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

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

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

Concatenates tensors along a dimension. Read more
§

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

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

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

Repeat the tensor along the given dimension. Read more
§

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

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

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

Gets the maximum element of a tensor. Read more
§

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

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

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

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

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

Gets the minimum element of a tensor. Read more
§

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

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

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

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

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

Element-wise power with a FloatTensor. Read more
§

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

Permutes the dimensions of a tensor. Read more
§

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

Broadcasts the float tensor to the given shape.
§

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

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

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

Returns a new tensor with rounded values. Read more
§

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

Returns a new tensor with floored values. Read more
§

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

Returns a new tensor with ceiled values. Read more
§

fn float_cast( tensor: <Fusion<B> as Backend>::FloatTensorPrimitive, dtype: FloatDType, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

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

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

Clamps a tensor under a minimum value. Read more
§

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

Clamps a tensor over a maximum value. Read more
§

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

Negates a tensor element-wise.
§

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

Transposes a tensor. Read more
§

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

Element-wise non-equality comparison. Read more
§

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

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

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

Detaches a tensor from the computation graph.
§

fn float_set_require_grad( tensor: <B as Backend>::FloatTensorPrimitive, _require_grad: bool, ) -> <B as Backend>::FloatTensorPrimitive

Sets the require_grad flag of a tensor.
§

fn float_is_require_grad(_tensor: &<B as Backend>::FloatTensorPrimitive) -> bool

Returns the require_grad flag of a tensor.
§

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

Element-wise power with an IntTensor. Read more
§

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

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

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

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

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

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

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

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

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

Split the tensor along the given dimension into chunks with sizes in dim according to split_sizes. Read more
§

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

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

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

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

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

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

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

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

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

Returns the signs of the float tensor. Read more
§

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

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

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

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

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

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

impl<B> IntTensorOps<Fusion<B>> for Fusion<B>
where B: FusionBackend,

§

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

Creates a new int tensor. Read more
§

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

Converts the tensor to a data structure. Read more
§

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

Creates a tensor from the data structure. Read more
§

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

Gets the device of the tensor. Read more
§

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

Moves the tensor to the given device.
§

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

Reshapes the tensor. Read more
§

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

Gets the element at the given indices. Read more
§

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

Sets the element at the given indices. Read more
§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Element-wise equality comparison. Read more
§

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

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

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

Element-wise greater than comparison. Read more
§

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

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

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

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

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

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

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

Element-wise less than comparison. Read more
§

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

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

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

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

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

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

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

Element-wise addition. Read more
§

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

Element-wise addition with a scalar. Read more
§

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

Element-wise subtraction. Read more
§

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

Element-wise subtraction with a scalar. Read more
§

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

Element-wise multiplication. Read more
§

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

Element-wise multiplication with a scalar. Read more
§

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

Element-wise division. Read more
§

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

Element-wise division with a scalar. Read more
§

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

Element-wise modulus. Read more
§

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

Element-wise modulus with a scalar. Read more
§

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

Creates a tensor of zeros. Read more
§

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

Creates a tensor of ones. Read more
§

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

Sums all elements in the tensor. Read more
§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Returns a new tensor with absolute values. Read more
§

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

Converts int tensor to float tensor. Read more
§

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

Swaps two dimensions of an int tensor. Read more
§

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

Gets the maximum element in the tensor. Read more
§

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

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

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

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

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

Gets the minimum element in the tensor. Read more
§

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

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

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

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

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

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

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

Permutes the dimensions of a tensor. Read more
§

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

Broadcasts the int tensor to the given shape.
§

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

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

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

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

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

Element-wise non-equality comparison. Read more
§

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

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

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

Element-wise power with a IntTensor. Read more
§

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

Element-wise power with a floatTensor. Read more
§

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

Element-wise power with a scalar. Read more
§

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

Element-wise power with a floatTensor. Read more
§

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

Clamps a tensor under a minimum value. Read more
§

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

Clamps a tensor over a maximum value. Read more
§

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

Element-wise negation. Read more
§

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

Creates a tensor filled with given value. Read more
§

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

Transposes an int tensor. Read more
§

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

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

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

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

fn int_split( tensor: <B as Backend>::IntTensorPrimitive, split_size: usize, dim: usize, ) -> Vec<<B as Backend>::IntTensorPrimitive>

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

fn int_split_with_sizes( tensor: <B as Backend>::IntTensorPrimitive, split_sizes: Vec<usize>, dim: usize, ) -> Vec<<B as Backend>::IntTensorPrimitive>

Split the tensor along the given dimension into chunks with sizes in dim according to split_sizes. Read more
§

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

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

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

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

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

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

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

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

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

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

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

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

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

Returns the signs of the int tensor. Read more
§

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

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

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

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

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

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

impl<B> ModuleOps<Fusion<B>> for Fusion<B>
where B: FusionBackend,

§

fn conv1d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, weight: <Fusion<B> as Backend>::FloatTensorPrimitive, bias: Option<<Fusion<B> as Backend>::FloatTensorPrimitive>, options: ConvOptions<1>, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

One dimensional convolution. Read more
§

fn conv2d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, weight: <Fusion<B> as Backend>::FloatTensorPrimitive, bias: Option<<Fusion<B> as Backend>::FloatTensorPrimitive>, options: ConvOptions<2>, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Two dimensional convolution. Read more
§

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

Two dimensional deformable convolution. Read more
§

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

Backward pass for the deform_conv2d operation.
§

fn conv3d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, weight: <Fusion<B> as Backend>::FloatTensorPrimitive, bias: Option<<Fusion<B> as Backend>::FloatTensorPrimitive>, options: ConvOptions<3>, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Three dimensional convolution. Read more
§

fn conv_transpose1d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, weight: <Fusion<B> as Backend>::FloatTensorPrimitive, bias: Option<<Fusion<B> as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<1>, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

One dimensional transposed convolution. Read more
§

fn conv_transpose2d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, weight: <Fusion<B> as Backend>::FloatTensorPrimitive, bias: Option<<Fusion<B> as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<2>, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Two dimensional transposed convolution. Read more
§

fn conv_transpose3d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, weight: <Fusion<B> as Backend>::FloatTensorPrimitive, bias: Option<<Fusion<B> as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<3>, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Three dimensional transposed convolution. Read more
§

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

One dimensional avg pooling. Read more
§

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

Two dimensional avg pooling. Read more
§

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

Backward pass for the avg pooling 1d operation.
§

fn avg_pool2d_backward( x: <Fusion<B> as Backend>::FloatTensorPrimitive, grad: <Fusion<B> as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Backward pass for the avg pooling 2d operation.
§

fn max_pool1d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

One dimensional max pooling. Read more
§

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

Two dimensional max pooling. Read more
§

fn max_pool1d_with_indices( x: <Fusion<B> as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> MaxPool1dWithIndices<Fusion<B>>

One dimensional max pooling with indices. Read more
§

fn max_pool2d_with_indices( x: <Fusion<B> as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> MaxPool2dWithIndices<Fusion<B>>

Two dimensional max pooling with indices. Read more
§

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

Backward pass for the max pooling 1d operation.
§

fn max_pool2d_with_indices_backward( x: <Fusion<B> as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], output_grad: <Fusion<B> as Backend>::FloatTensorPrimitive, indices: <Fusion<B> as Backend>::IntTensorPrimitive, ) -> MaxPool2dBackward<Fusion<B>>

Backward pass for the max pooling 2d operation.
§

fn adaptive_avg_pool1d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, output_size: usize, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

One dimensional adaptive avg pooling. Read more
§

fn adaptive_avg_pool2d( x: <Fusion<B> as Backend>::FloatTensorPrimitive, output_size: [usize; 2], ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Two dimensional adaptive avg pooling. Read more
§

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

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

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

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

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

Down/up samples the input. Read more
§

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

Backward pass for the interpolate operation.
§

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

Embedding operation. Read more
§

fn embedding_backward( weights: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive

Embedding backward operation. Read more
§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Four-dimensional unfolding. Read more
§

impl<B> QTensorOps<Fusion<B>> for Fusion<B>
where B: FusionBackend,

§

fn q_from_data( data: TensorData, device: &<Fusion<B> as Backend>::Device, ) -> <Fusion<B> as Backend>::QuantizedTensorPrimitive

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

fn quantize( tensor: <Fusion<B> as Backend>::FloatTensorPrimitive, scheme: &QuantizationScheme, qparams: QuantizationParametersPrimitive<Fusion<B>>, ) -> <Fusion<B> as Backend>::QuantizedTensorPrimitive

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

fn dequantize( tensor: <Fusion<B> as Backend>::QuantizedTensorPrimitive, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

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

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

Gets the device of the tensor. Read more
§

fn q_to_device( tensor: <Fusion<B> as Backend>::QuantizedTensorPrimitive, device: &<Fusion<B> as Backend>::Device, ) -> <Fusion<B> as Backend>::QuantizedTensorPrimitive

Moves the tensor to the given device. Read more
§

fn q_reshape( _tensor: <Fusion<B> as Backend>::QuantizedTensorPrimitive, _shape: Shape, ) -> <Fusion<B> as Backend>::QuantizedTensorPrimitive

Reshapes a tensor. Read more
§

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

Converts the tensor to a data structure. Read more
§

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

Swaps two dimensions of a tensor. Read more
§

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

Permutes the dimensions of a tensor. Read more
§

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

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

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

Gather elements from a tensor. Read more
§

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

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

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

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

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

Broadcasts the tensor to the given shape.
§

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

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

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

Detaches a tensor from the computation graph.
§

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

Sets the require_grad flag of a tensor.
§

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

Returns the require_grad flag of a tensor.
§

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

Repeat the tensor along the given dimension. Read more
§

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

Adds two tensors together. Read more
§

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

Adds a scalar to a tensor. Read more
§

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

Clamps a tensor under a minimum value. Read more
§

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

Clamps a tensor over a maximum value. Read more
§

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

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

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

Subtracts two tensors. Read more
§

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

Subtracts a scalar from a tensor. Read more
§

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

Multiplies two tensors together element-wise.
§

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

Multiplies a tensor by a scalar. Read more
§

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

Divides two tensors element-wise. Read more
§

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

Divides a tensor by a scalar. Read more
§

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

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

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

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

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

Multiplies two tensors together using matrix multiplication. Read more
§

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

Negates a tensor element-wise.
§

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

Calculates the reciprocals element-wise
§

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

Transposes a tensor. Read more
§

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

Scatter elements into a tensor. Read more
§

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

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

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

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

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

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

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

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

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

Sum of all elements in a tensor. Read more
§

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

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

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

Product of all elements in a tensor. Read more
§

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

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

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

Mean of all elements in a tensor. Read more
§

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

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

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

Returns a new tensor with exponential values. Read more
§

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

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

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

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

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

Element-wise power with another tensor. Read more
§

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

Element-wise power with an IntTensor. Read more
§

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

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

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

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

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

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

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

Returns a new tensor with absolute values. Read more
§

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

Returns a new tensor with cosine values. Read more
§

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

Returns a new tensor with sine values. Read more
§

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

Returns a new tensor with tangent values. Read more
§

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

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

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

Concatenates tensors along a dimension. Read more
§

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

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

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

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

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

Gets the maximum element of a tensor. Read more
§

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

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

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

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

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

Gets the minimum element of a tensor. Read more
§

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

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

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

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

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

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

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

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

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

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

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

Split the tensor along the given dimension into chunks with sizes in dim according to split_sizes. Read more
§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<B> ReprBackend for Fusion<B>
where B: FusionBackend,

§

type Handle = FusionTensor<<B as FusionBackend>::FusionRuntime>

The type that can be used to point to a tensor of any kind.
§

fn float_tensor( handle: TensorHandle<<Fusion<B> as ReprBackend>::Handle>, ) -> <Fusion<B> as Backend>::FloatTensorPrimitive

Convert a handle to a float tensor.
§

fn int_tensor( handle: TensorHandle<<Fusion<B> as ReprBackend>::Handle>, ) -> <Fusion<B> as Backend>::IntTensorPrimitive

Convert a handle to an int tensor.
§

fn bool_tensor( handle: TensorHandle<<Fusion<B> as ReprBackend>::Handle>, ) -> <Fusion<B> as Backend>::BoolTensorPrimitive

Convert a handle to a bool tensor.
§

fn quantized_tensor( handle: TensorHandle<<Fusion<B> as ReprBackend>::Handle>, ) -> <Fusion<B> as Backend>::QuantizedTensorPrimitive

Convert a handle to a quantized tensor.
§

fn float_tensor_handle( tensor: <Fusion<B> as Backend>::FloatTensorPrimitive, ) -> <Fusion<B> as ReprBackend>::Handle

Convert a float tensor to a handle.
§

fn int_tensor_handle( tensor: <Fusion<B> as Backend>::IntTensorPrimitive, ) -> <Fusion<B> as ReprBackend>::Handle

Convert an int tensor to a handle.
§

fn bool_tensor_handle( tensor: <Fusion<B> as Backend>::BoolTensorPrimitive, ) -> <Fusion<B> as ReprBackend>::Handle

Convert a bool tensor to a handle.
§

fn quantized_tensor_handle( tensor: <Fusion<B> as Backend>::QuantizedTensorPrimitive, ) -> <Fusion<B> as ReprBackend>::Handle

Convert a quantized tensor to a handle.
§

impl<B> TransactionOps<Fusion<B>> for Fusion<B>
where B: FusionBackend,

§

fn tr_execute( transaction: TransactionPrimitive<Fusion<B>>, ) -> impl Future<Output = TransactionPrimitiveResult> + Send + 'static

Executes a transaction and return its result.