Closed zekyll closed 5 years ago
I was under the impression that tensors are only evaluated once during a single call to eval, and the value is then cached for later uses. It seems to work like that in most cases, but I tried a simple example with some inconsistent results:
eval
let ref a : ag::Tensor<f64> = ag::random_normal(&[1], 0.0, 1.0); println!("{:?}", ag::eval(&[a - a], &[])); println!("{:?}", ag::eval(&[a - 1.0 * a], &[]));
The first one produces a value 0 as expected. However the second one is always a nonzero value, so it seems to call the random number generator twice.
Fixed in v0.9.5!
I was under the impression that tensors are only evaluated once during a single call to
eval
, and the value is then cached for later uses. It seems to work like that in most cases, but I tried a simple example with some inconsistent results:The first one produces a value 0 as expected. However the second one is always a nonzero value, so it seems to call the random number generator twice.