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

Wrong result from example in the docs if integer args #11

Open
ggventurini opened this issue May 10, 2015 · 0 comments
Open

Wrong result from example in the docs if integer args #11

ggventurini opened this issue May 10, 2015 · 0 comments

Comments

@ggventurini
Copy link

Hi,

I am trying out pyautodiff and I ran into the following problem:

from autodiff import gradient

@gradient
def f(x):
    return x**2

print(f(100))

Prints out:

0.0

Which is wrong.

Instead if I call print(f(100.)) -- notice the dot, which makes the argument a float -- I get the correct result:

200.0

Am I missing something? Am I doing something wrong?

Thanks for all the good work!

GV


System information:

  • Python 3.3.5 |Anaconda 1.9.1 (x86_64)| (default, Sep 2 2014, 13:57:31)
  • pyautodiff from the python3 branch, up to date (HEAD 7973e26)
  • Theano 0.7.0
  • Numpy 1.9.2
  • Meta 0.4.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant