Skip to content

Commit ab4d9c3

Browse files
committed
address comments
1 parent 292c927 commit ab4d9c3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/smoke_test.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,21 @@ def main() -> None:
8080
print(f"torchvision: {torchvision.__version__}")
8181
print(f"torch.cuda.is_available: {torch.cuda.is_available()}")
8282

83-
if re.match(r"\d+\.\d+\.\d+(?!a0)", torchvision.__version__):
83+
# The "a0" after the semantic version should only be present on the main branch or nightly builds,
84+
# but not release branches.
85+
if re.match(r"\d+\.\d+\.\d+(?!a0)\+", torchvision.__version__):
8486
try:
85-
import torchvision.prototype as _
87+
from torchvision import prototype
8688
except ModuleNotFoundError:
8789
pass
8890
else:
8991
raise AssertionError(
9092
"torchvision.prototype available on a release version. "
91-
"Run\n\n"
92-
"rm -rf torchvision/prototype test/test_prototype* .github/workflows/prototype*"
93+
"Run rm -r torchvision/prototype test/test_prototype* .github/workflows/prototype*"
9394
)
9495

95-
major_minor_version = torchvision.__version__.split(".")[:2]
96-
if major_minor_version >= (0, 16):
97-
print(f"{torch.ops.image._jpeg_version() = }")
98-
assert torch.ops.image._is_compiled_against_turbo()
96+
print(f"{torch.ops.image._jpeg_version() = }")
97+
assert torch.ops.image._is_compiled_against_turbo()
9998

10099
smoke_test_torchvision()
101100
smoke_test_torchvision_read_decode()

0 commit comments

Comments
 (0)