ferrite/network/
parameter.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::{cell::RefCell, rc::Rc};
use crate::{autograd::tensor::*, TensorCreation};

pub struct Parameter {
  pub tensor: Rc<RefCell<Tensor>>,
}

impl Parameter {
  pub fn new(shape: Vec<usize>) -> Self {
    Parameter {
      tensor: Rc::new(RefCell::new(Tensor::zeros(shape, Some(true)))),
    }
  }
}