Add a couple operators.

This commit is contained in:
laurent
2023-06-20 22:32:11 +01:00
parent f1f372b13e
commit 78bac0ed32
3 changed files with 93 additions and 9 deletions

View File

@ -2,13 +2,17 @@ use crate::Tensor;
pub(crate) enum Op {
Add(Tensor, Tensor),
Mul(Tensor, Tensor),
Sub(Tensor, Tensor),
Div(Tensor, Tensor),
#[allow(dead_code)] // add is currently unused.
Affine {
arg: Tensor,
mul: f64,
add: f64,
},
Mul(Tensor, Tensor),
Neg(Tensor),
Sqr(Tensor),
Sqrt(Tensor),
// TODO: Support for custom ops.