Function autograd::ops::sub_inplace [] [src]

pub fn sub_inplace(a: Tensor, b: &Tensor) -> Tensor

Inplace subtraction

Returns a after performing a -= b. This function moves a.

Panics

When a is a constant.

extern crate ndarray;
extern crate autograd as ag;

let mut ctx = ag::Context::new();

let a = ag::ones(&[2, 2]);
let ref b = ag::ones(&[2, 2]);
let ref c = ag::sub_inplace(a, b);

assert_eq!(c.eval(&mut ctx), ndarray::arr2(&[[0., 0.], [0., 0.]]).into_dyn());