Unverified Commit 761f725b authored by Ruohui Wang's avatar Ruohui Wang Committed by GitHub
Browse files

Misc updates regarding Windows and unittests (#586)

* SKIP bbox test without CUDA

* use full filepath for creating latest.pth
parent 2e6c8ec8
...@@ -169,7 +169,7 @@ class EpochBasedRunner(BaseRunner): ...@@ -169,7 +169,7 @@ class EpochBasedRunner(BaseRunner):
if platform.system() != 'Windows': if platform.system() != 'Windows':
mmcv.symlink(filename, dst_file) mmcv.symlink(filename, dst_file)
else: else:
shutil.copy(filename, dst_file) shutil.copy(filepath, dst_file)
@RUNNERS.register_module() @RUNNERS.register_module()
......
import numpy as np import numpy as np
import pytest
import torch import torch
@pytest.mark.skipif(
not torch.cuda.is_available(), reason='requires CUDA support')
class TestBBox(object): class TestBBox(object):
def _test_bbox_overlaps(self, dtype=torch.float): def _test_bbox_overlaps(self, dtype=torch.float):
if not torch.cuda.is_available():
return
from mmcv.ops import bbox_overlaps from mmcv.ops import bbox_overlaps
b1 = torch.tensor([[1.0, 1.0, 3.0, 4.0], [2.0, 2.0, 3.0, 4.0], b1 = torch.tensor([[1.0, 1.0, 3.0, 4.0], [2.0, 2.0, 3.0, 4.0],
[7.0, 7.0, 8.0, 8.0]]).cuda().type(dtype) [7.0, 7.0, 8.0, 8.0]]).cuda().type(dtype)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment