Trait ModuleOps

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

Source

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

Source

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

Source

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.

Source

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

Source

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

Source

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

Source

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

Source

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.

Source

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

Source

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.

Source

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

Source

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

Source

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.

Source

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

Source

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§

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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

Source

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.

Source

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

Source

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.

Source

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

Source

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

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§