Skip to content

Commit 6218dc3

Browse files
authored
guard against deprecation of binom_test (#7404)
1 parent e59cf64 commit 6218dc3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/test_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ def test_stochastic_depth_random(self, seed, mode, p):
16401640
counts += batch_size - non_zero_count
16411641
num_samples += batch_size
16421642

1643-
p_value = stats.binom_test(counts, num_samples, p=p)
1643+
p_value = stats.binomtest(counts, num_samples, p=p).pvalue
16441644
assert p_value > 0.01
16451645

16461646
@pytest.mark.parametrize("seed", range(10))

test/test_transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ def test_random_order():
14451445
if out == resize_crop_out:
14461446
num_normal_order += 1
14471447

1448-
p_value = stats.binom_test(num_normal_order, num_samples, p=0.5)
1448+
p_value = stats.binomtest(num_normal_order, num_samples, p=0.5).pvalue
14491449
random.setstate(random_state)
14501450
assert p_value > 0.0001
14511451

@@ -1851,7 +1851,7 @@ def test_random_erasing(seed):
18511851
aspect_ratios.append(h / w)
18521852

18531853
count_bigger_then_ones = len([1 for aspect_ratio in aspect_ratios if aspect_ratio > 1])
1854-
p_value = stats.binom_test(count_bigger_then_ones, trial, p=0.5)
1854+
p_value = stats.binomtest(count_bigger_then_ones, trial, p=0.5).pvalue
18551855
assert p_value > 0.0001
18561856

18571857
# Checking if RandomErasing can be printed as string

0 commit comments

Comments
 (0)