Type Definition aegir::ops::TensorDot

source ·
pub type TensorDot<L, R> = Contract<1, L, R>;
Expand description

Operator alias that applies f[g,h](x) = h(x) · g(x) element-wise to a buffer.

Examples

let f = TensorDot::new(X.into_var(), Y.into_var());
let ctx = ctx!{
    X = [1.0, 2.0, 3.0],
    Y = [-1.0, 0.0, 2.0]
};

assert_eq!(f.evaluate_dual(X, &ctx).unwrap(), dual!(5.0, [-1.0, 0.0, 2.0]));
assert_eq!(f.evaluate_dual(Y, &ctx).unwrap(), dual!(5.0, [1.0, 2.0, 3.0]));

Trait Implementations§

Formats the value using the given formatter. Read more
Convert the node to an expression string. Read more