Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stubs/tensorflow/tensorflow/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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.