@@ -545,8 +545,9 @@ def update_bounds_float(summary, value, number_dim):
545
545
value = np .array (value , dtype = np .float32 , copy = False )
546
546
# Map back to python types to avoid JSON issues later. Could
547
547
# be done more efficiently at the end.
548
- summary .max_value = float (max (summary .max_value , np .max (value )))
549
- summary .min_value = float (min (summary .min_value , np .min (value )))
548
+ if value .size > 0 :
549
+ summary .min_value = float (min (summary .min_value , np .min (value )))
550
+ summary .max_value = float (max (summary .max_value , np .max (value )))
550
551
number = 0
551
552
assert len (value .shape ) <= number_dim + 1
552
553
if len (value .shape ) == number_dim + 1 :
@@ -564,8 +565,9 @@ def update_bounds_integer(summary, value, number_dim):
564
565
value = np .array (value , dtype = np .int32 , copy = False )
565
566
# Mask out missing and fill values
566
567
a = value [value >= MIN_INT_VALUE ]
567
- summary .max_value = int (max (summary .max_value , np .max (a )))
568
- summary .min_value = int (min (summary .min_value , np .min (a )))
568
+ if a .size > 0 :
569
+ summary .max_value = int (max (summary .max_value , np .max (a )))
570
+ summary .min_value = int (min (summary .min_value , np .min (a )))
569
571
number = 0
570
572
assert len (value .shape ) <= number_dim + 1
571
573
if len (value .shape ) == number_dim + 1 :
0 commit comments