Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent tensor caching #17

Closed
zekyll opened this issue Jul 11, 2019 · 1 comment
Closed

Inconsistent tensor caching #17

zekyll opened this issue Jul 11, 2019 · 1 comment
Labels

Comments

@zekyll
Copy link

zekyll commented Jul 11, 2019

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:

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.

@raskr raskr added the bug label Jul 12, 2019
@raskr
Copy link
Owner

raskr commented Jul 14, 2019

Fixed in v0.9.5!

@raskr raskr closed this as completed Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants