Move the variable creation to the variable module. (#159)

* Move the variable creation to the variable module.

* Make it possible to set a variable.

* Add some basic gradient descent test.

* Get the gradient descent test to work.
This commit is contained in:
Laurent Mazare
2023-07-13 16:55:40 +01:00
committed by GitHub
parent 6991036bc5
commit 5ee3c95582
5 changed files with 137 additions and 80 deletions

View File

@ -109,6 +109,9 @@ pub enum Error {
#[error("cannot broadcast {src_shape:?} to {dst_shape:?}")]
BroadcastIncompatibleShapes { src_shape: Shape, dst_shape: Shape },
#[error("cannot set variable {msg}")]
CannotSetVar { msg: &'static str },
// Box indirection to avoid large variant.
#[error("{0:?}")]
MatMulUnexpectedStriding(Box<MatMulUnexpectedStriding>),