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

Method test_ill_input_shape

tests/networks/nets/test_unet.py:195–199  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

193 test_script_save(net, test_data)
194
195 def test_ill_input_shape(self):
196 net = UNet(spatial_dims=2, in_channels=1, out_channels=3, channels=(16, 32, 64), strides=(2, 2))
197 with eval_mode(net):
198 with self.assertRaisesRegex(RuntimeError, "Sizes of tensors must match"):
199 net.forward(torch.randn(2, 1, 16, 5))
200
201 @parameterized.expand(ILL_CASES)
202 def test_ill_input_hyper_params(self, input_param):

Callers

nothing calls this directly

Calls 3

forwardMethod · 0.95
UNetClass · 0.90
eval_modeFunction · 0.90

Tested by

no test coverage detected