Skip to content

Commit b103773

Browse files
committed
A little more refactoring
1 parent 64a2160 commit b103773

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/smoke_test/smoke_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ def smoke_test_torchvision() -> None:
4141
print('Is torchvision useable?', all(x is not None for x in [torch.ops.image.decode_png, torch.ops.torchvision.roi_align]))
4242

4343
def smoke_test_torchvision_read_decode() -> None:
44-
from torchvision.io import decode_image, read_file
45-
img_jpg = read_file(str(pathlib.Path(__file__).parent / 'assets' / 'rgb_pytorch.jpg'))
46-
img_jpg_nv = decode_image(img_jpg)
47-
img_png = read_file(str(pathlib.Path(__file__).parent / 'assets' / 'rgb_pytorch.png'))
48-
img_png_nv = decode_image(img_png)
44+
from torchvision.io import read_image
45+
img_jpg = read_image(str(pathlib.Path(__file__).parent / 'assets' / 'rgb_pytorch.jpg'))
46+
assert img_jpg.ndim == 3 and img_jpg.numel() > 100
47+
img_png = read_image(str(pathlib.Path(__file__).parent / 'assets' / 'rgb_pytorch.png'))
48+
assert img_png.ndim == 3 and img_png.numel() > 100
4949

5050
def smoke_test_torchvision_resnet50_classify() -> None:
5151
from torchvision.io import read_image
5252
from torchvision.models import resnet50, ResNet50_Weights
5353

5454
img = read_image(str(pathlib.Path(__file__).parent / 'assets' / 'dog2.jpg'))
55-
assert img.ndim == 3 and img.numel() > 100
55+
5656
# Step 1: Initialize model with the best available weights
5757
weights = ResNet50_Weights.DEFAULT
5858
model = resnet50(weights=weights)

0 commit comments

Comments
 (0)