Esempio n. 1
0
 def test_ahnet_shape(self, input_param, input_shape, expected_shape, fcn_input_param):
     net = AHNet(**input_param).to(device)
     net2d = FCN(**fcn_input_param).to(device)
     net.copy_from(net2d)
     net.eval()
     with torch.no_grad():
         result = net.forward(torch.randn(input_shape).to(device))
         self.assertEqual(result.shape, expected_shape)
Esempio n. 2
0
 def test_fcn_shape(self, input_param, input_data, expected_shape):
     net = AHNet(**input_param)
     net.eval()
     with torch.no_grad():
         result = net.forward(input_data)
         self.assertEqual(result.shape, expected_shape)
Esempio n. 3
0
 def test_ahnet_shape(self, input_param, input_shape, expected_shape):
     net = AHNet(**input_param)
     net.eval()
     with torch.no_grad():
         result = net.forward(torch.randn(input_shape))
         self.assertEqual(result.shape, expected_shape)