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

Fixed "reset_state" of R2Score metric #18251

Merged
merged 1 commit into from Jun 29, 2023

Conversation

pdyakov
Copy link
Contributor

@pdyakov pdyakov commented Jun 23, 2023

"reset_state" method of R2Score metric throws an error:
ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: <tf.Tensor: shape=(), dtype=float32, numpy=0.0>
Quick fix is to specify original "dtype" of variable when assigning it to zeros.

@google-cla
Copy link

google-cla bot commented Jun 23, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Jun 23, 2023
@gbaned gbaned requested a review from fchollet June 23, 2023 14:52
Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jun 27, 2023
@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Jun 27, 2023
copybara-service bot pushed a commit that referenced this pull request Jun 29, 2023
Imported from GitHub PR #18251

"reset_state" method of R2Score metric throws an error:
`ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: <tf.Tensor: shape=(), dtype=float32, numpy=0.0>`
Quick fix is to specify original "dtype" of variable when assigning it to zeros.
Copybara import of the project:

--
fd6692a by Pavel Dyakov <pl.dyakov@gmail.com>:

Fixed "reset_state" of R2Score metric

Merging this change closes #18251

FUTURE_COPYBARA_INTEGRATE_REVIEW=#18251 from pdyakov:patch-1 fd6692a
PiperOrigin-RevId: 544417576
copybara-service bot pushed a commit that referenced this pull request Jun 29, 2023
Imported from GitHub PR #18251

"reset_state" method of R2Score metric throws an error:
`ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: <tf.Tensor: shape=(), dtype=float32, numpy=0.0>`
Quick fix is to specify original "dtype" of variable when assigning it to zeros.
Copybara import of the project:

--
fd6692a by Pavel Dyakov <pl.dyakov@gmail.com>:

Fixed "reset_state" of R2Score metric

Merging this change closes #18251

FUTURE_COPYBARA_INTEGRATE_REVIEW=#18251 from pdyakov:patch-1 fd6692a
PiperOrigin-RevId: 544417576
@copybara-service copybara-service bot merged commit 0423639 into keras-team:master Jun 29, 2023
6 of 7 checks passed
PR Queue automation moved this from Approved by Reviewer to Merged Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review ready to pull Ready to be merged into the codebase size:XS
Projects
PR Queue
Merged
Development

Successfully merging this pull request may close these issues.

None yet

4 participants