We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f79111e commit ba5eed8Copy full SHA for ba5eed8
tests/test_utils/test_dl_utils/test_torch_ops.py
@@ -1,15 +1,15 @@
1
# Copyright (c) OpenMMLab. All rights reserved.
2
-import pytest
+import warnings
3
+
4
import torch
5
6
from mmengine.utils.dl_utils import torch_meshgrid
7
8
9
def test_torch_meshgrid():
10
# torch_meshgrid should not throw warning
- with pytest.warns(None) as record:
11
+ with warnings.catch_warnings():
12
+ warnings.simplefilter('error')
13
x = torch.tensor([1, 2, 3])
14
y = torch.tensor([4, 5, 6])
15
grid_x, grid_y = torch_meshgrid(x, y)
-
- assert len(record) == 0
0 commit comments