Remove remaining bare Incompletes (#11768)

Enable Y065
This commit is contained in:
Sebastian Rittau
2024-04-16 15:26:14 +02:00
committed by GitHub
parent 7c8e82fe48
commit 7d56cd9a6c
33 changed files with 110 additions and 100 deletions

View File

@@ -182,7 +182,7 @@ class RaggedTensor(metaclass=ABCMeta):
class Operation:
def __init__(
self,
node_def: Incomplete,
node_def,
g: Graph,
# isinstance is used so can not be Sequence/Iterable.
inputs: list[Tensor] | None = None,
@@ -190,7 +190,7 @@ class Operation:
control_inputs: Iterable[Tensor | Operation] | None = None,
input_types: Iterable[DType] | None = None,
original_op: Operation | None = None,
op_def: Incomplete = None,
op_def: Incomplete | None = None,
) -> None: ...
@property
def inputs(self) -> list[Tensor]: ...
@@ -301,7 +301,7 @@ class TypeSpec(ABC, Generic[_SpecProto]):
def experimental_type_proto(cls) -> type[_SpecProto]: ...
def is_compatible_with(self, spec_or_value: Self | TensorCompatible | SparseTensor | RaggedTensor) -> _bool: ...
# Incomplete as tf.types is not yet covered.
def is_subtype_of(self, other: Incomplete) -> _bool: ...
def is_subtype_of(self, other) -> _bool: ...
def most_specific_common_supertype(self, others: Sequence[Incomplete]) -> Self | None: ...
def most_specific_compatible_type(self, other: Self) -> Self: ...

View File

@@ -1,4 +1,3 @@
from _typeshed import Incomplete
from collections.abc import Callable, Iterable, Mapping, Sequence
from typing import Any, Literal
from typing_extensions import TypeAlias
@@ -148,7 +147,7 @@ class ReduceLROnPlateau(Callback):
min_delta: float = 1e-4,
cooldown: int = 0,
min_lr: float = 0,
**kwargs: Incomplete,
**kwargs,
) -> None: ...
def in_cooldown(self) -> bool: ...

View File

@@ -4,6 +4,6 @@ import tensorflow as tf
from tensorflow.keras.layers.experimental.preprocessing import PreprocessingLayer
class _IndexLookup(PreprocessingLayer):
def compute_output_signature(self, input_spec: Incomplete) -> tf.TensorSpec: ...
def compute_output_signature(self, input_spec) -> tf.TensorSpec: ...
def get_vocabulary(self, include_special_tokens: bool = True) -> list[Incomplete]: ...
def vocabulary_size(self) -> int: ...

View File

@@ -26,8 +26,8 @@ class Model(Layer[_InputT, _OutputT], tf.Module):
def __new__(cls, *args: Any, **kwargs: Any) -> Model[_InputT, _OutputT]: ...
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def __setattr__(self, name: str, value: Any) -> None: ...
def __reduce__(self) -> Incomplete: ...
def __deepcopy__(self, memo: Incomplete) -> Incomplete: ...
def __reduce__(self): ...
def __deepcopy__(self, memo): ...
def build(self, input_shape: ShapeLike) -> None: ...
def __call__(self, inputs: _InputT, *, training: bool = False, mask: TensorCompatible | None = None) -> _OutputT: ...
def call(self, inputs: _InputT, training: bool | None = None, mask: TensorCompatible | None = None) -> _OutputT: ...
@@ -61,7 +61,7 @@ class Model(Layer[_InputT, _OutputT], tf.Module):
def jit_compile(self) -> bool: ...
@property
def distribute_reduction_method(self) -> Incomplete | Literal["auto"]: ...
def train_step(self, data: TensorCompatible) -> Incomplete: ...
def train_step(self, data: TensorCompatible): ...
def compute_loss(
self,
x: TensorCompatible | None = None,
@@ -70,7 +70,7 @@ class Model(Layer[_InputT, _OutputT], tf.Module):
sample_weight: Incomplete | None = None,
) -> tf.Tensor | None: ...
def compute_metrics(
self, x: TensorCompatible, y: TensorCompatible, y_pred: TensorCompatible, sample_weight: Incomplete
self, x: TensorCompatible, y: TensorCompatible, y_pred: TensorCompatible, sample_weight
) -> dict[str, float]: ...
def get_metrics_result(self) -> dict[str, float]: ...
def make_train_function(self, force: bool = False) -> Callable[[tf.data.Iterator[Incomplete]], dict[str, float]]: ...
@@ -186,7 +186,7 @@ class Model(Layer[_InputT, _OutputT], tf.Module):
def trainable_weights(self) -> list[Variable]: ...
@property
def non_trainable_weights(self) -> list[Variable]: ...
def get_weights(self) -> Incomplete: ...
def get_weights(self): ...
def save(
self, filepath: str | Path, overwrite: bool = True, save_format: Literal["keras", "tf", "h5"] | None = None, **kwargs: Any
) -> None: ...

View File

@@ -1,4 +1,3 @@
from _typeshed import Incomplete
from enum import Enum
from typing_extensions import Self
@@ -24,7 +23,7 @@ class Fingerprint:
version: Integer | None = None,
) -> None: ...
@classmethod
def from_proto(cls, proto: Incomplete) -> Self: ...
def from_proto(cls, proto) -> Self: ...
def singleprint(self) -> str: ...
class TrackableResource(CapturableResource):

View File

@@ -24,6 +24,6 @@ class GenericFunction(Callable[_P, _R], metaclass=abc.ABCMeta):
def get_concrete_function(
self, *args: ContainerGeneric[tf.TypeSpec[Any]], **kwargs: ContainerGeneric[tf.TypeSpec[Any]]
) -> ConcreteFunction[_P, _R]: ...
def experimental_get_compiler_ir(self, *args: Incomplete, **kwargs: Incomplete) -> Incomplete: ...
def experimental_get_compiler_ir(self, *args, **kwargs): ...
def __getattr__(name: str) -> Incomplete: ...