File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
tensorflow_probability/python/internal Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ def assertAllInRange(self,
613613 'The value of %s does not have an ordered numeric type, instead it '
614614 'has type: %s' % (target , target .dtype ))
615615
616- nan_subscripts = np .where (np .isnan (target ))
616+ nan_subscripts = np .where (np .atleast_1d ( np . isnan (target ) ))
617617 if np .size (nan_subscripts ):
618618 raise AssertionError (
619619 '%d of the %d element(s) are NaN. '
@@ -631,7 +631,7 @@ def assertAllInRange(self,
631631 violations ,
632632 np .greater_equal (target , upper_bound )
633633 if open_upper_bound else np .greater (target , upper_bound ))
634- violation_subscripts = np .where (violations )
634+ violation_subscripts = np .where (np . atleast_1d ( violations ) )
635635 if np .size (violation_subscripts ):
636636 raise AssertionError (
637637 '%d of the %d element(s) are outside the range %s. ' %
You can’t perform that action at this time.
0 commit comments