def test_transform(self):
        # square input
        image = np.random.randn(1, 20, 20)
        rings = [5, 2]
        encoded_size = get_encoded_size(image.shape[1], image.shape[2], rings)
        assert encoded_size == 64, "Different from  previously computed value"
        self.foveate_defoveate_channel(image, rings, encoded_size)

        # non-square input
        rec_image = np.random.randn(1, 70, 42)
        rec_rings = [7, 4, 2]
        rec_encoded_size = get_encoded_size(rec_image.shape[1],
                                            rec_image.shape[2], rec_rings)
        assert rec_encoded_size == 834, "Not previously computed value"
        self.foveate_defoveate_channel(rec_image, rec_rings,
                                       rec_encoded_size)

        # bs > 1
        rec_image = np.random.randn(3, 70, 42)
        rec_rings = [7, 4, 2]
        rec_encoded_size = get_encoded_size(rec_image.shape[1],
                                            rec_image.shape[2], rec_rings)
        assert rec_encoded_size == 834, "Not previously computed value"
        self.foveate_defoveate_channel(rec_image, rec_rings,
                                       rec_encoded_size, bs=rec_image.shape[0])
This runs tests on the foveate/defoveate channel
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/datasets/tests/test_retina.py/test_retina.test_transform