Consistently use Generic as the last base class (#10610)

This commit is contained in:
Nikita Sobolev
2023-08-28 11:16:54 +03:00
committed by GitHub
parent 3b9ab5e9b1
commit 2c1db00761
15 changed files with 17 additions and 17 deletions

View File

@@ -345,7 +345,7 @@ class GradientTape:
_SpecProto = TypeVar("_SpecProto", bound=Message)
class TypeSpec(Generic[_SpecProto], ABC):
class TypeSpec(ABC, Generic[_SpecProto]):
@property
@abstractmethod
def value_type(self) -> Any: ...

View File

@@ -27,7 +27,7 @@ class Iterator(_Iterator[_T1], Trackable, ABC):
@abstractmethod
def get_next_as_optional(self) -> tf.experimental.Optional[_T1]: ...
class Dataset(Generic[_T1], ABC):
class Dataset(ABC, Generic[_T1]):
def apply(self, transformation_func: Callable[[Dataset[_T1]], Dataset[_T2]]) -> Dataset[_T2]: ...
def as_numpy_iterator(self) -> Iterator[np.ndarray[Any, Any]]: ...
def batch(

View File

@@ -4,7 +4,7 @@ from typing import Generic, TypeVar
_T_co = TypeVar("_T_co", covariant=True)
class Optional(Generic[_T_co], ABC):
class Optional(ABC, Generic[_T_co]):
def __getattr__(self, name: str) -> Incomplete: ...
def __getattr__(name: str) -> Incomplete: ...