Use typing_extensions.Self instead of _typeshed.Self (#9702)

This commit is contained in:
Alex Waygood
2023-02-15 11:32:43 +01:00
committed by GitHub
parent 8cd6d81f15
commit 7180d0223b
140 changed files with 597 additions and 610 deletions

View File

@@ -1,11 +1,11 @@
from _typeshed import Incomplete, Self, Unused
from _typeshed import Incomplete, Unused
from abc import ABCMeta
from builtins import bool as _bool
from collections.abc import Callable, Iterable, Iterator, Sequence
from contextlib import contextmanager
from enum import Enum
from typing import Any, NoReturn, overload
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias
import numpy
@@ -222,7 +222,7 @@ class Graph:
def add_to_collection(self, name: str, value: object) -> None: ...
def add_to_collections(self, names: Iterable[str] | str, value: object) -> None: ...
@contextmanager
def as_default(self: Self) -> Iterator[Self]: ...
def as_default(self) -> Iterator[Self]: ...
def finalize(self) -> None: ...
def get_tensor_by_name(self, name: str) -> Tensor: ...
def get_operation_by_name(self, name: str) -> Operation: ...