Skip to content

Commit

Permalink
Remove some dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
jakevdp committed Mar 6, 2024
1 parent fc8dc83 commit b349328
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions jax/_src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,19 +650,13 @@ def check_integer_conversion(arr: Array):
raise TypeError("Only integer scalar arrays can be converted to a scalar index.")


def check_bool_conversion(arr: Array, warn_on_empty=False):
def check_bool_conversion(arr: Array):
if arr.size == 0:
if warn_on_empty:
warnings.warn(
"The truth value of an empty array is ambiguous. Returning False. In the future this "
"will result in an error. Use `array.size > 0` to check that an array is not empty.",
DeprecationWarning, stacklevel=3)
else:
raise ValueError("The truth value of an empty array is ambiguous. Use "
"`array.size > 0` to check that an array is not empty.")
raise ValueError("The truth value of an empty array is ambiguous. Use"
" `array.size > 0` to check that an array is not empty.")
if arr.size > 1:
raise ValueError("The truth value of an array with more than one element is "
"ambiguous. Use a.any() or a.all()")
raise ValueError("The truth value of an array with more than one element"
" is ambiguous. Use a.any() or a.all()")


def _aval_property(name):
Expand Down

0 comments on commit b349328

Please sign in to comment.