tensorflow: Change Tensor.__bool__ return from NoReturn to bool (#13562)

This commit is contained in:
Hoël Bagard
2025-03-01 03:20:14 +09:00
committed by GitHub
parent be17dc0ac4
commit 20aef1d78f
+2 -2
View File
@@ -6,7 +6,7 @@ from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
from contextlib import contextmanager
from enum import Enum
from types import TracebackType
from typing import Any, Generic, Literal, NoReturn, TypeVar, overload
from typing import Any, Generic, Literal, TypeVar, overload
from typing_extensions import ParamSpec, Self
from google.protobuf.message import Message
@@ -125,7 +125,7 @@ class Tensor:
def __gt__(self, other: TensorCompatible, name: str | None = None) -> Tensor: ...
def __le__(self, other: TensorCompatible, name: str | None = None) -> Tensor: ...
def __lt__(self, other: TensorCompatible, name: str | None = None) -> Tensor: ...
def __bool__(self) -> NoReturn: ...
def __bool__(self) -> _bool: ...
def __getitem__(self, slice_spec: Slice | tuple[Slice, ...]) -> Tensor: ...
def __len__(self) -> int: ...
# This only works for rank 0 tensors.