Skip to content

Commit 751246c

Browse files
committed
fix: add __init__ and __new__ to Metric
1 parent 940a997 commit 751246c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stubs/tensorflow/tensorflow/keras/metrics.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
from _typeshed import Incomplete
1+
from typing import Any, Self
22

33
from tensorflow import Tensor, _TensorCompatible
4+
from tensorflow.dtypes import DType
45

5-
class Metric(Incomplete): ...
6+
class Metric:
7+
def __init__(self, name: str, dtype: DType) -> None: ...
8+
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
69

710
def binary_crossentropy(
811
y_true: _TensorCompatible, y_pred: _TensorCompatible, from_logits: bool = False, label_smoothing: float = 0.0, axis: int = -1

0 commit comments

Comments
 (0)