Skip to main content

conv_general_dilated

Function conv_general_dilated 

Source
pub fn conv_general_dilated<T: Element>(
    lhs: &[T],
    lshape: &[usize],
    rhs: &[T],
    rshape: &[usize],
    w: &ConvWindow<'_>,
    d: &ConvDims,
    feature_group_count: usize,
    batch_group_count: usize,
) -> Vec<T>
Expand description

conv_general_dilated: XLA’s convolution, with feature groups (the input features and the output features are split into feature_group_count groups, and output group g sees input group g) and batch groups (the input batch is split into batch_group_count groups, the major part of the batch dimension, and output feature group g sees batch group g).

Each result is accumulated in the result type, over the kernel’s spatial positions in row-major order and, for each, over the input features, as XLA’s CPU backend does for f64 (with fused multiply-adds, which gives the same bits) and for 16-bit floats (in f32, rounded once). XLA sums f32 convolutions in another order (with Eigen). Padding and the holes of the input dilation contribute nothing (not 0 * w, which differs for an infinite or NaN w).