ndtensor 0.1.1

An n-dimensional tensor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
    Appellation: Tensor <test>
    Contrib: @FL03
*/
use ndtensor::Tensor;

#[test]
fn test_ones_and_zeros() {
    // weights retain the given shape (d_in, d_out)
    // bias retains the shape (d_out,)
    let ones = Tensor::<f64>::ones((3, 4));
    assert_eq!(ones.dim(), (3, 4));
    // weights retain the given shape (d_in, d_out)
    // bias retains the shape (d_out,)
    let zeros = Tensor::<f64>::zeros((3, 4));
    assert_eq!(zeros.dim(), (3, 4));
}