Skip to content

Commit

Permalink
Revert "improve smoke test"
Browse files Browse the repository at this point in the history
This reverts commit 6b9db82.
  • Loading branch information
pmeier committed May 1, 2023
1 parent 355410b commit 7844bca
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/smoke_test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""Run smoke tests"""

import os
import sys
from pathlib import Path

import torch
import torch.nn as nn
import torchvision
from torchvision.io import decode_jpeg, read_file, read_image
from torchvision.io import read_image
from torchvision.models import resnet50, ResNet50_Weights

SCRIPT_DIR = Path(__file__).parent
Expand All @@ -27,13 +29,6 @@ def smoke_test_torchvision_read_decode() -> None:
raise RuntimeError(f"Unexpected shape of img_png: {img_png.shape}")


def smoke_test_torchvision_decode_jpeg_cuda():
img_jpg_data = read_file(str(SCRIPT_DIR / "assets" / "encode_jpeg" / "grace_hopper_517x606.jpg"))
img_jpg = decode_jpeg(img_jpg_data, device="cuda")
if img_jpg.ndim != 3 or img_jpg.numel() < 100:
raise RuntimeError(f"Unexpected shape of img_jpg: {img_jpg.shape}")


def smoke_test_compile() -> None:
try:
model = resnet50().cuda()
Expand Down Expand Up @@ -82,7 +77,6 @@ def main() -> None:
smoke_test_torchvision_read_decode()
smoke_test_torchvision_resnet50_classify()
if torch.cuda.is_available():
smoke_test_torchvision_decode_jpeg_cuda()
smoke_test_torchvision_resnet50_classify("cuda")
smoke_test_compile()

Expand Down

0 comments on commit 7844bca

Please sign in to comment.