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

Initialize gradient of uninitialized parameter with default dtype when initializer is callable #5064

Merged
merged 1 commit into from Jul 13, 2018

Conversation

takagi
Copy link
Member

@takagi takagi commented Jul 5, 2018

This PR follows up #4510.

The gradient of an uninitialized parameter was always initialized with NaN of numpy.float32 when its initializer was a callable, in contrast to its data that was initialized with the default dtype. This caused mismatch of dtypes between the data and the gradient.

This PR fixes it to use the default dtype to initialize the gradient in such case so that the data and the gradient have the same dtype.

@takagi takagi added the cat:enhancement Implementation that does not break interfaces. label Jul 5, 2018
@mitmul
Copy link
Member

mitmul commented Jul 10, 2018

Jenkins, test this please.

@mitmul mitmul self-assigned this Jul 10, 2018
@chainer-ci
Copy link
Member

Jenkins CI test (for commit 63f2466) failed with status FAILURE.
(For contributors, please wait until the reviewer confirms the details of the error.)

@takagi
Copy link
Member Author

takagi commented Jul 10, 2018

Jenkins, test this please.

@chainer-ci
Copy link
Member

Jenkins CI test (for commit 63f2466) succeeded without errors!

@okuta okuta added the st:test-and-merge State indicating that pull request is approved by a reviewer and can be merged after CI passes. label Jul 13, 2018
@okuta okuta self-assigned this Jul 13, 2018
@okuta okuta added this to the v5.0.0b3 milestone Jul 13, 2018
@okuta
Copy link
Member

okuta commented Jul 13, 2018

LGTM!

@okuta okuta merged commit c888ad9 into chainer:master Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:enhancement Implementation that does not break interfaces. st:test-and-merge State indicating that pull request is approved by a reviewer and can be merged after CI passes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants