test_imvoxel_neck.py 456 Bytes
Newer Older
VVsssssk's avatar
VVsssssk committed
1
2
3
import pytest
import torch

4
from mmdet3d.registry import MODELS
VVsssssk's avatar
VVsssssk committed
5
6
7
8
9
10
11
12


def test_imvoxel_neck():
    if not torch.cuda.is_available():
        pytest.skip('test requires GPU and torch+cuda')

    neck_cfg = dict(
        type='OutdoorImVoxelNeck', in_channels=64, out_channels=256)
13
    neck = MODELS.build(neck_cfg).cuda()
VVsssssk's avatar
VVsssssk committed
14
15
16
    inputs = torch.rand([1, 64, 216, 248, 12], device='cuda')
    outputs = neck(inputs)
    assert outputs[0].shape == (1, 256, 248, 216)