code: def test_old_pool_interface(self):
      if sys.version_info[0] != 3:
          # Only tested with python 3 because of pickling issues.
          raise SkipTest("Skip old pool interface with python 2.x")
      # 1. Load the old version
      testfile_dir = os.path.dirname(os.path.realpath(__file__))
      fname = "old_pool_interface.pkl"
      with open(os.path.join(testfile_dir, fname), "rb") as fp:
          try:
              old_fct = cPickle.load(fp, encoding="latin1")
          except ImportError:
              # Windows sometimes fail with nonsensical errors like:
              #   ImportError: No module named type
              #   ImportError: No module named copy_reg
              # when "type" and "copy_reg" are builtin modules.
              if sys.platform == "win32":
                  exc_type, exc_value, exc_trace = sys.exc_info()
                  reraise(SkipTest, exc_value, exc_trace)
              raise
      # 2. Create the new version
      x = theano.tensor.ftensor4()
      y = pool_2d(x, (2, 2), mode="max", ignore_border=True)
      z = pool_2d(x, (2, 2), mode="average_exc_pad", ignore_border=True)
      dy_dx = theano.gradient.grad(y.sum(), x)
      dz_dx = theano.gradient.grad(z.sum(), x)
      new_fct = theano.function([x], [y, z, dy_dx, dz_dx])
      # 3. Assert that the answer is the same
      rng = np.random.RandomState(utt.fetch_seed())
      image_val = rng.rand(4, 6, 7, 9).astype(np.float32)
      old_out = old_fct(image_val)
      new_out = new_fct(image_val)
      for o, n in zip(old_out, new_out):
          utt.assert_allclose(o, n)
  
imports: from __future__ import absolute_import, print_function, division
  from nose.plugins.skip import SkipTest
  from parameterized import parameterized
  from itertools import product
  import os
  import unittest
  from six import reraise
  from six.moves import cPickle
  import six.moves.builtins
  import sys
  import numpy
  import theano
  import theano.tensor
  from theano.tests import unittest_tools
  from theano.tensor.signal.pool import Pool, pool_2d, pool_3d, MaxPoolGrad, AveragePoolGrad, max_pool_2d_same_size, DownsampleFactorMaxGradGrad
  from theano import function
label_desc: Use image node_id 32 for calling the TestDownsampleFactorMax obj's underlying member method code with example usage: obj.test_old_pool_interface() without return types