Skip to content

Commit ef8f4fc

Browse files
author
jax authors
committed
Merge pull request #20105 from jakevdp:dead-code
PiperOrigin-RevId: 613293830
2 parents 1cb8d31 + b349328 commit ef8f4fc

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

jax/_src/core.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -650,19 +650,13 @@ def check_integer_conversion(arr: Array):
650650
raise TypeError("Only integer scalar arrays can be converted to a scalar index.")
651651

652652

653-
def check_bool_conversion(arr: Array, warn_on_empty=False):
653+
def check_bool_conversion(arr: Array):
654654
if arr.size == 0:
655-
if warn_on_empty:
656-
warnings.warn(
657-
"The truth value of an empty array is ambiguous. Returning False. In the future this "
658-
"will result in an error. Use `array.size > 0` to check that an array is not empty.",
659-
DeprecationWarning, stacklevel=3)
660-
else:
661-
raise ValueError("The truth value of an empty array is ambiguous. Use "
662-
"`array.size > 0` to check that an array is not empty.")
655+
raise ValueError("The truth value of an empty array is ambiguous. Use"
656+
" `array.size > 0` to check that an array is not empty.")
663657
if arr.size > 1:
664-
raise ValueError("The truth value of an array with more than one element is "
665-
"ambiguous. Use a.any() or a.all()")
658+
raise ValueError("The truth value of an array with more than one element"
659+
" is ambiguous. Use a.any() or a.all()")
666660

667661

668662
def _aval_property(name):

0 commit comments

Comments
 (0)