File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 11"""Run smoke tests"""
22
3+ import os
34import sys
45from pathlib import Path
56
67import torch
8+ import torch .nn as nn
79import torchvision
8- from torchvision .io import decode_jpeg , read_file , read_image
10+ from torchvision .io import read_image
911from torchvision .models import resnet50 , ResNet50_Weights
1012
1113SCRIPT_DIR = Path (__file__ ).parent
@@ -27,13 +29,6 @@ def smoke_test_torchvision_read_decode() -> None:
2729 raise RuntimeError (f"Unexpected shape of img_png: { img_png .shape } " )
2830
2931
30- def smoke_test_torchvision_decode_jpeg_cuda ():
31- img_jpg_data = read_file (str (SCRIPT_DIR / "assets" / "encode_jpeg" / "grace_hopper_517x606.jpg" ))
32- img_jpg = decode_jpeg (img_jpg_data , device = "cuda" )
33- if img_jpg .ndim != 3 or img_jpg .numel () < 100 :
34- raise RuntimeError (f"Unexpected shape of img_jpg: { img_jpg .shape } " )
35-
36-
3732def smoke_test_compile () -> None :
3833 try :
3934 model = resnet50 ().cuda ()
@@ -82,7 +77,6 @@ def main() -> None:
8277 smoke_test_torchvision_read_decode ()
8378 smoke_test_torchvision_resnet50_classify ()
8479 if torch .cuda .is_available ():
85- smoke_test_torchvision_decode_jpeg_cuda ()
8680 smoke_test_torchvision_resnet50_classify ("cuda" )
8781 smoke_test_compile ()
8882
You can’t perform that action at this time.
0 commit comments