Unverified Commit aef00c4d authored by vfdev's avatar vfdev Committed by GitHub
Browse files

Fixed broken test_random_choice (#7315)

parent 74e33657
......@@ -1359,7 +1359,7 @@ class TestContainers:
class TestRandomChoice:
def test_assertions(self):
with pytest.raises(ValueError, match="The number of probabilities doesn't match the number of transforms"):
with pytest.raises(ValueError, match="Length of p doesn't match the number of transforms"):
transforms.RandomChoice([transforms.Pad(2), transforms.RandomCrop(28)], p=[1])
......
......@@ -822,7 +822,7 @@ class TestContainerTransforms:
v2_transforms.Resize(256),
legacy_transforms.CenterCrop(224),
],
probabilities=probabilities,
p=probabilities,
)
legacy_transform = legacy_transforms.RandomChoice(
[
......
......@@ -139,7 +139,7 @@ class RandomChoice(Transform):
p = [1] * len(transforms)
elif len(p) != len(transforms):
raise ValueError(
f"The number of p doesn't match the number of transforms: " f"{len(p)} != {len(transforms)}"
f"Length of p doesn't match the number of transforms: " f"{len(p)} != {len(transforms)}"
)
super().__init__()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment