native_neural_network 0.3.1

Lib no_std Rust for native neural network (.rnn)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::tensor::TensorView;

pub fn conv5d_layout_compatible(input: &TensorView<'_>, kernel: &TensorView<'_>, output: &TensorView<'_>) -> bool {
    if input.shape[1] != kernel.shape[1] {
        return false;
    }
    if output.shape[0] != input.shape[0] {
        return false;
    }
    if output.shape[1] != kernel.shape[0] {
        return false;
    }
    input.is_valid_layout() && kernel.is_valid_layout() && output.is_valid_layout()
}

pub fn conv5d_is_compatible(input: &TensorView<'_>, kernel: &TensorView<'_>, output: &TensorView<'_>) -> bool {
    conv5d_layout_compatible(input, kernel, output)
}