Skip to content

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

Description

@ggventurini

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions