MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_shape

Method test_shape

tests/networks/nets/test_quicknat.py:42–48  ·  view source on GitHub ↗
(self, input_param, input_shape, expected_shape)

Source from the content-addressed store, hash-verified

40class TestQuicknat(unittest.TestCase):
41 @parameterized.expand(TEST_CASES)
42 def test_shape(self, input_param, input_shape, expected_shape):
43 device = "cuda" if torch.cuda.is_available() else "cpu"
44 print(input_param)
45 net = Quicknat(**input_param).to(device)
46 with eval_mode(net):
47 result = net(torch.randn(input_shape).to(device))
48 self.assertEqual(result.shape, expected_shape)
49
50 def test_script(self):
51 net = Quicknat(num_classes=1, num_channels=1)

Callers

nothing calls this directly

Calls 2

QuicknatClass · 0.90
eval_modeFunction · 0.90

Tested by

no test coverage detected