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

Method test_shape

tests/networks/nets/test_milmodel.py:67–72  ·  view source on GitHub ↗
(self, input_param, input_shape, expected_shape)

Source from the content-addressed store, hash-verified

65class TestMilModel(unittest.TestCase):
66 @parameterized.expand(TEST_CASE_MILMODEL)
67 def test_shape(self, input_param, input_shape, expected_shape):
68 with skip_if_downloading_fails():
69 net = MILModel(**input_param).to(device)
70 with eval_mode(net):
71 result = net(torch.randn(input_shape, dtype=torch.float).to(device))
72 self.assertEqual(result.shape, expected_shape)
73
74 def test_ill_args(self):
75 with self.assertRaises(ValueError):

Callers

nothing calls this directly

Calls 3

MILModelClass · 0.90
eval_modeFunction · 0.90

Tested by

no test coverage detected