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

Method test_backward

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

Source from the content-addressed store, hash-verified

51
52 @parameterized.expand(TEST_CASES)
53 def test_backward(self, img_shape):
54 n_dims = len(img_shape[1:])
55 x = self.get_data(img_shape)
56 t = Fourier()
57 out = t.inv_shift_fourier(x, n_dims)
58
59 expect = torch.fft.ifftn(
60 torch.fft.ifftshift(x, dim=tuple(range(-n_dims, 0))), dim=tuple(range(-n_dims, 0))
61 ).real
62
63 np.testing.assert_allclose(out, expect)
64
65
66if __name__ == "__main__":

Callers

nothing calls this directly

Calls 3

get_dataMethod · 0.95
inv_shift_fourierMethod · 0.95
FourierClass · 0.90

Tested by

no test coverage detected