Trait burn::tensor::ops::ModuleOps

pub trait ModuleOps<B>
where B: Backend,
{
Show 45 methods // Required methods fn conv2d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive; fn deform_conv2d( x: <B as Backend>::FloatTensorPrimitive, offset: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, mask: Option<<B as Backend>::FloatTensorPrimitive>, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: DeformConvOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive; fn deform_conv2d_backward( x: <B as Backend>::FloatTensorPrimitive, offset: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, mask: Option<<B as Backend>::FloatTensorPrimitive>, bias: Option<<B as Backend>::FloatTensorPrimitive>, output_grad: <B as Backend>::FloatTensorPrimitive, options: DeformConvOptions<2>, ) -> DeformConv2dBackward<B>; fn conv3d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive; fn conv_transpose2d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive; fn conv_transpose3d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive; fn avg_pool2d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive; fn avg_pool2d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive; fn adaptive_avg_pool2d( x: <B as Backend>::FloatTensorPrimitive, output_size: [usize; 2], ) -> <B as Backend>::FloatTensorPrimitive; fn adaptive_avg_pool2d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive; fn max_pool2d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> <B as Backend>::FloatTensorPrimitive; fn max_pool2d_with_indices( x: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], ) -> MaxPool2dWithIndices<B>; fn max_pool2d_with_indices_backward( x: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], stride: [usize; 2], padding: [usize; 2], dilation: [usize; 2], output_grad: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> MaxPool2dBackward<B>; fn interpolate( x: <B as Backend>::FloatTensorPrimitive, output_size: [usize; 2], options: InterpolateOptions, ) -> <B as Backend>::FloatTensorPrimitive; fn interpolate_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, output_size: [usize; 2], options: InterpolateOptions, ) -> <B as Backend>::FloatTensorPrimitive; // Provided methods fn embedding( weights: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn embedding_backward( weights: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn conv1d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive { ... } 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 { ... } 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 { ... } fn conv1d_bias_backward( x: <B as Backend>::FloatTensorPrimitive, bias: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive { ... } 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 { ... } 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 { ... } 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 { ... } 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 { ... } 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 { ... } 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 { ... } fn conv_transpose1d( x: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn conv_transpose1d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive { ... } 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 { ... } 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 { ... } fn conv_transpose2d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<2>, ) -> <B as Backend>::FloatTensorPrimitive { ... } 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 { ... } 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 { ... } fn conv_transpose3d_x_backward( weight: <B as Backend>::FloatTensorPrimitive, output_grad: <B as Backend>::FloatTensorPrimitive, options: ConvTransposeOptions<3>, ) -> <B as Backend>::FloatTensorPrimitive { ... } 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 { ... } 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 { ... } fn unfold4d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: [usize; 2], options: UnfoldOptions, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn avg_pool1d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, count_include_pad: bool, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn adaptive_avg_pool1d( x: <B as Backend>::FloatTensorPrimitive, output_size: usize, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn adaptive_avg_pool1d_backward( x: <B as Backend>::FloatTensorPrimitive, grad: <B as Backend>::FloatTensorPrimitive, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn max_pool1d( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> <B as Backend>::FloatTensorPrimitive { ... } fn max_pool1d_with_indices( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, ) -> MaxPool1dWithIndices<B> { ... } fn max_pool1d_with_indices_backward( x: <B as Backend>::FloatTensorPrimitive, kernel_size: usize, stride: usize, padding: usize, dilation: usize, output_grad: <B as Backend>::FloatTensorPrimitive, indices: <B as Backend>::IntTensorPrimitive, ) -> MaxPool1dBackward<B> { ... }
}
Expand description

Module operations trait.

Required Methods§

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

Two dimensional convolution.

§Shapes

x: [batch_size, channels_in, height, width], weight: [channels_out, channels_in, kernel_size_1, kernel_size_2], bias: [channels_out],

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

Two dimensional deformable convolution.

§Shapes

x: [batch_size, channels_in, height, width], weight: [channels_out, channels_in, kernel_size_1, kernel_size_2], bias: [channels_out],

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

Backward pass for the deform_conv2d operation.

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

Three dimensional convolution.

§Shapes

x: [batch_size, channels_in, depth, height, width], weight: [channels_out, channels_in, kernel_size_1, kernel_size_2, kernel_size_3], bias: [channels_out],

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

Two dimensional transposed convolution.

§Shapes

x: [batch_size, channels_in, height, width], weight: [channels_in, channels_out, kernel_size_1, kernel_size_2], bias: [channels_out],

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

Three dimensional transposed convolution.

§Shapes

x: [batch_size, channels_in, height, width], weight: [channels_in, channels_out, kernel_size_1, kernel_size_2, kernel_size_3], bias: [channels_out],

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

Two dimensional avg pooling.

§Shapes

x: [batch_size, channels, height, width],

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

Backward pass for the avg pooling 2d operation.

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

Two dimensional adaptive avg pooling.

§Shapes

x: [batch_size, channels, height, width],

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

Backward pass for the adaptive avg pooling 2d operation.

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

Two dimensional max pooling.

§Shapes

x: [batch_size, channels, height, width],

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

Two dimensional max pooling with indices.

§Shapes

x: [batch_size, channels, height, width],

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

Backward pass for the max pooling 2d operation.

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

Down/up samples the input.

§Shapes

x: [batch_size, channels, height, width],

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

Backward pass for the interpolate operation.

Provided Methods§

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

Embedding operation.

§Arguments
  • weights - The embedding weights.
  • indices - The indices tensor.
§Returns

The output tensor.

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.

§Arguments
  • weights - The embedding weights.
  • output_grad - The output gradient.
  • indices - The indices tensor.
§Returns

The gradient.

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

One dimensional convolution.

§Shapes

x: [batch_size, channels_in, length], weight: [channels_out, channels_in, kernel_size], bias: [channels_out],

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: <B as Backend>::FloatTensorPrimitive, weight: <B as Backend>::FloatTensorPrimitive, bias: Option<<B as Backend>::FloatTensorPrimitive>, options: ConvTransposeOptions<1>, ) -> <B as Backend>::FloatTensorPrimitive

One dimensional transposed convolution.

§Shapes

x: [batch_size, channels_in, length], weight: [channels_in, channels_out, length], bias: [channels_out],

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.

§Shapes

x: [batch_size, channels_in, height, width], returns: [batch_size, channels_in * kernel_size_1 * kernel_size_2, number of blocks],

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

One dimensional avg pooling.

§Shapes

x: [batch_size, channels, length],

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

Backward pass for the avg pooling 1d operation.

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

One dimensional adaptive avg pooling.

§Shapes

x: [batch_size, channels, length],

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

Backward pass for the adaptive avg pooling 1d operation.

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

One dimensional max pooling.

§Shapes

x: [batch_size, channels, length],

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

One dimensional max pooling with indices.

§Shapes

x: [batch_size, channels, height, width],

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

Backward pass for the max pooling 1d operation.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

Implementors§

§

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

§

impl<E, I, Q> ModuleOps<NdArray<E, I, Q>> for NdArray<E, I, Q>
where E: FloatNdArrayElement, I: IntNdArrayElement, Q: QuantElement,

§

impl<E, Q> ModuleOps<LibTorch<E, Q>> for LibTorch<E, Q>
where E: TchElement, Q: QuantElement,

§

impl<F, I> ModuleOps<Candle<F, I>> for Candle<F, I>
where F: FloatCandleElement, I: IntCandleElement,

§

impl<R, F, I> ModuleOps<JitBackend<R, F, I>> for JitBackend<R, F, I>
where R: JitRuntime, F: FloatElement, I: IntElement,