rotta_rs 0.0.5

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, NodeType, Tensor };

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

    tensor
}

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