ACCC1380's picture
download
raw
914 Bytes
"""Exercise the compiled operator that failed after restoring the backup."""
import sys
from pathlib import Path
import torch
import torchvision
root = Path(sys.prefix).resolve()
for module in (torch, torchvision):
if not Path(module.__file__).resolve().is_relative_to(root):
raise RuntimeError(f"{module.__name__} was imported outside {root}")
assert torch.__version__ == "2.14.0+cu130", torch.__version__
assert torchvision.__version__ == "0.29.0+cu130", torchvision.__version__
assert torch.cuda.is_available(), "CUDA unavailable: check the NVIDIA driver/GPU"
for device in ("cpu", "cuda"):
boxes = torch.tensor([[0., 0., 2., 2.], [0., 0., 2., 2.]], device=device)
scores = torch.tensor([0.9, 0.8], device=device)
assert torchvision.ops.nms(boxes, scores, 0.5).tolist() == [0]
print(f"Runtime OK: torch {torch.__version__}, torchvision {torchvision.__version__}, CPU/CUDA NMS passed")

Xet Storage Details

Size:
914 Bytes
·
Xet hash:
77749f97b6bb393c55cdf80e1af180deb8863d66f440a98f39fc52154c5444cc

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.