mirror of
https://github.com/ROCm/jax.git
synced 2025-04-16 03:46:06 +00:00
Error on conversion of empty arrays to boolean.
PiperOrigin-RevId: 595264332
This commit is contained in:
parent
985a042d9a
commit
c06e186f60
@ -36,6 +36,8 @@ Remember to align the itemized text with the first line of an item within a list
|
||||
* from {mod}`jax.scipy.linalg`: `tril` and `triu`.
|
||||
* The previously-deprecated method `PRNGKeyArray.unsafe_raw_array` has been
|
||||
removed. Use {func}`jax.random.key_data` instead.
|
||||
* `bool(empty_array)` now raises an error rather than returning `False`. This
|
||||
previously raised a deprecation warning, and follows a similar change in NumPy.
|
||||
|
||||
## jaxlib 0.4.24
|
||||
|
||||
|
@ -262,9 +262,7 @@ class ArrayImpl(basearray.Array):
|
||||
raise TypeError("len() of unsized object") from err # same as numpy error
|
||||
|
||||
def __bool__(self):
|
||||
# deprecated 2023 September 18.
|
||||
# TODO(jakevdp) change to warn_on_empty=False
|
||||
core.check_bool_conversion(self, warn_on_empty=True)
|
||||
core.check_bool_conversion(self)
|
||||
return bool(self._value)
|
||||
|
||||
def __float__(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user