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

Readme example differentiation typo #50

Closed
HeinOldewage opened this issue Oct 18, 2016 · 1 comment
Closed

Readme example differentiation typo #50

HeinOldewage opened this issue Oct 18, 2016 · 1 comment

Comments

@HeinOldewage
Copy link

The code only prints the value if an error occurred. The ifs should test for err == nil.

if xgrad, err := x.Grad(); err != nil {
    fmt.Printf("dz/dx: %v", xgrad)
}

if ygrad, err := y.Grad(); err != nil {
    fmt.Printf("dz/dy: %v", ygrad)
}
@chewxy
Copy link
Member

chewxy commented Oct 19, 2016

Right you are! Could you make a PR? I'm abroad atm, but can merge pull requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants