

def test_gaussian_pyramid_shapes():
    for dtype in ('float32', 'float64'):
        x = theano.tensor.tensor4(dtype=dtype)
        f = theano.function([x], GaussianPyramid(3)(x))
        xval = numpy.ones((1, 64, 64, 1), dtype=dtype)
        (a, b, c) = f(xval)
        assert (a.shape == (1, 64, 64, 1))
        assert (b.shape == (1, 32, 32, 1))
        assert (c.shape == (1, 16, 16, 1))
        xval = numpy.ones((1, 12, 12, 10), dtype=dtype)
        (a, b, c) = f(xval)
        assert (a.shape == (1, 12, 12, 10))
        assert (b.shape == (1, 6, 6, 10))
        assert (c.shape == (1, 3, 3, 10))
        p = GaussianPyramid(1)(x)
        f = theano.function([x], dtype)
        (a,) = f(xval)
        assert (a.shape == xval.shape)

dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/packaged_dependencies/theano_linear/pyramid.py test_gaussian_pyramid_shapes/VarMisuse@242/265 `p`->`dtype`