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

Method test_shape

tests/networks/nets/test_autoencoder.py:78–82  ·  view source on GitHub ↗
(self, input_param, input_shape, expected_shape)

Source from the content-addressed store, hash-verified

76class TestAutoEncoder(unittest.TestCase):
77 @parameterized.expand(CASES)
78 def test_shape(self, input_param, input_shape, expected_shape):
79 net = AutoEncoder(**input_param).to(device)
80 with eval_mode(net):
81 result = net.forward(torch.randn(input_shape).to(device))
82 self.assertEqual(result.shape, expected_shape)
83
84 def test_script(self):
85 net = AutoEncoder(spatial_dims=2, in_channels=1, out_channels=1, channels=(4, 8), strides=(2, 2))

Callers

nothing calls this directly

Calls 3

AutoEncoderClass · 0.90
eval_modeFunction · 0.90
forwardMethod · 0.45

Tested by

no test coverage detected