rotta_rs 0.1.0

a Deep Learning library with rust language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{ rotta_rs_module::{ BackwardLabel, Tensor }, ShareTensor };

pub fn sign(x: &Tensor) -> Tensor {
    let mut tensor = Tensor::from_arrayy(x.value.read().unwrap().sign());
    tensor.update_parent(vec![x.shared_tensor()]);
    tensor.update_label(Some(BackwardLabel::Sign(x.shared_tensor())));

    tensor
}

pub fn d_sign(x: &ShareTensor) {
    // dx = 0 * grad = 0
    x.zero_grad();
}