Tensor5

Type Alias Tensor5 

Source
pub type Tensor5<const X: usize, const Y: usize, const Z: usize, const W: usize, const V: usize> = Tensor<Dim5<X, Y, Z, W, V>>;
Expand description

A 5-th order tensor.

Aliased Type§

pub struct Tensor5<const X: usize, const Y: usize, const Z: usize, const W: usize, const V: usize> {
    pub inner: <Dim5<X, Y, Z, W, V> as Dimension>::ArrayForm,
}

Fields§

§inner: <Dim5<X, Y, Z, W, V> as Dimension>::ArrayForm

Implementations§

Source§

impl<const X: usize, const Y: usize, const Z: usize, const W: usize, const V: usize> Tensor5<X, Y, Z, W, V>
where [f32; { _ }]: Sized,

Source

pub fn convolution<const KX: usize, const BX: usize, const KY: usize, const BY: usize, const KZ: usize, const BZ: usize, const KW: usize, const BW: usize, const KV: usize, const BV: usize>( &self, kernel: &Tensor5<KX, KY, KZ, KW, KV>, stride: &[usize], ) -> Tensor5<BX, BY, BZ, BW, BV>
where [f32; { _ }]: Sized,

Computes the convolution with padded 0.

§Stride

The stride parameter controls the amount that kernel moves in each iteration. Note that it panics when any elememt in stride[..5] is 0 or stride.len() < 5. If unsure, use &[1; 5]

§Note

Each dimension of the output must be ceil((self + kernel) / stride) - 1 or else there will be a runtime panic. It is not checked during compile time due to Rust type bound limits.