Passed
Push — main ( 61f0e5...8543db )
by Fernando
01:52
created

tests.transforms.preprocessing.test_crop.TestCrop.test_subject_copy()   A

Complexity

Conditions 1

Size

Total Lines 12
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nop 1
dl 0
loc 12
rs 9.85
c 0
b 0
f 0
1
import torch
2
3
import torchio as tio
4
5
from ...utils import TorchioTestCase
6
7
8
class TestCrop(TorchioTestCase):
9
    def test_tensor_single_channel(self):
10
        crop = tio.Crop(1)
11
        assert crop(torch.rand(1, 10, 10, 10)).shape == (1, 8, 8, 8)
12
13
    def test_tensor_multi_channel(self):
14
        crop = tio.Crop(1)
15
        assert crop(torch.rand(3, 10, 10, 10)).shape == (3, 8, 8, 8)
16