tensorfllow
: Tensor.__bool__
's signature is incorrect for one element tensors #13365
Open
Description
CurrentlyTensor.__bool__
's signature is as follows:
class Tensor:
def __bool__(self) -> NoReturn: ...
It suggests that the method should never be called, however the following is valid code:
import tensorflow as tf
bool(tf.constant([1]))
Since this depends on the shape of the tensor, I don't know if this can be fixed, but it would be nice to have.
Metadata
Assignees
Labels
No labels