Skip to content

tensorflow: add a few missing elements#15265

Merged
srittau merged 10 commits intopython:mainfrom
hoel-bagard:tf-missing-types
Jan 12, 2026
Merged

tensorflow: add a few missing elements#15265
srittau merged 10 commits intopython:mainfrom
hoel-bagard:tf-missing-types

Conversation

@hoel-bagard
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Comments/questions below.

@@ -99,6 +99,9 @@ class Accuracy(MeanMetricWrapper):
class CategoricalAccuracy(MeanMetricWrapper):
def __init__(self, name: str | None = "categorical_accuracy", dtype: DTypeLike | None = None) -> None: ...

class Mean(MeanMetricWrapper):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In tensorflow 2.18.1 (which is the latest version typeshed supports), this derives from Reduce:

https://github.com/tensorflow/tensorflow/blob/3614e11d59e4727197c6bf1c12e3cb95994fca8d/tensorflow/python/keras/metrics.py#L488

Copy link
Copy Markdown
Contributor Author

@hoel-bagard hoel-bagard Jan 12, 2026

Choose a reason for hiding this comment

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

Sorry, I've fixed it in bfc1bdb.

Comment thread stubs/tensorflow/tensorflow/__init__.pyi
Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

A few more comments.

Comment thread stubs/tensorflow/tensorflow/keras/metrics.pyi Outdated
Comment thread stubs/tensorflow/tensorflow/keras/metrics.pyi
hoel-bagard and others added 2 commits January 12, 2026 22:59
Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>
Comment thread stubs/tensorflow/tensorflow/keras/metrics.pyi Outdated
Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>
Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@hoel-bagard
Copy link
Copy Markdown
Contributor Author

Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 47c0e2d into python:main Jan 12, 2026
48 checks passed
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

Successfully merging this pull request may close these issues.

2 participants