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

Method test_forward

tests/transforms/test_fourier.py:42–50  ·  view source on GitHub ↗
(self, img_shape)

Source from the content-addressed store, hash-verified

40
41 @parameterized.expand(TEST_CASES)
42 def test_forward(self, img_shape):
43 n_dims = len(img_shape[1:])
44 x = self.get_data(img_shape)
45 t = Fourier()
46 out = t.shift_fourier(x, n_dims)
47
48 expect = torch.fft.fftshift(torch.fft.fftn(x, dim=tuple(range(-n_dims, 0))), dim=tuple(range(-n_dims, 0)))
49
50 np.testing.assert_allclose(out, expect)
51
52 @parameterized.expand(TEST_CASES)
53 def test_backward(self, img_shape):

Callers

nothing calls this directly

Calls 3

get_dataMethod · 0.95
shift_fourierMethod · 0.95
FourierClass · 0.90

Tested by

no test coverage detected