We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Possibly wrong doc or code for deconvolution cover_all
The documentation says:

```
cover_all (bool): If True, all spatial locations are convoluted into
            some output pixels. It may make the output size larger.
```

However, when I prepare a small toy example, the output is larger when `cover_all=True`. I feel like either the code or the documentation needs to be inverted.

See an [gist notebook](https://gist.github.com/LukasDrude/8a9ebbaa3a6ba4ae0e2bef611afefd5a) for the toy example or the attached screenshot. I had set the weight matrices to ones and disabled normalization for clarity.

![screen shot 2016-07-01 at 14 54 08](https://cloud.githubusercontent.com/assets/1886882/16522122/fa0d9554-3f9b-11e6-8f2c-3ea75a9b0a5b.png)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `chainer/functions/pooling/unpooling_2d.py`
Content:
```
1 from chainer import cuda
2 from chainer.functions.pooling import pooling_2d
3 from chainer.utils import conv
4 from chainer.utils import type_check
5 
6 
7 class Unpooling2D(pooling_2d.Pooling2D):
8 
9     """Unpooling over a set of 2d planes."""
10 
11     def __init__(self, ksize, stride=None, pad=0,
12                  outsize=None, cover_all=True):
13         super(Unpooling2D, self).__init__(ksize, stride, pad, cover_all)
14         self.outh, self.outw = (None, None) if outsize is None else outsize
15 
16     def check_type_forward(self, in_types):
17         n_in = in_types.size()
18         type_check.expect(n_in == 1)
19         x_type = in_types[0]
20 
21         type_check.expect(
22             x_type.dtype.kind == 'f',
23             x_type.ndim == 4,
24         )
25 
26         if self.outh is not None:
27             expected_h = conv.get_conv_outsize(
28                 self.outh, self.kh, self.sy, self.ph, cover_all=self.cover_all)
29             type_check.expect(x_type.shape[2] == expected_h)
30         if self.outw is not None:
31             expected_w = conv.get_conv_outsize(
32                 self.outw, self.kw, self.sx, self.pw, cover_all=self.cover_all)
33             type_check.expect(x_type.shape[3] == expected_w)
34 
35     def forward(self, x):
36         h, w = x[0].shape[2:]
37         if self.outh is None:
38             self.outh = conv.get_deconv_outsize(
39                 h, self.kh, self.sy, self.ph, cover_all=self.cover_all)
40         if self.outw is None:
41             self.outw = conv.get_deconv_outsize(
42                 w, self.kw, self.sx, self.pw, cover_all=self.cover_all)
43         xp = cuda.get_array_module(*x)
44         col = xp.tile(x[0][:, :, None, None],
45                       (1, 1, self.kh, self.kw, 1, 1))
46         if isinstance(x[0], cuda.ndarray):
47             y = conv.col2im_gpu(col, self.sy, self.sx, self.ph, self.pw,
48                                 self.outh, self.outw)
49         else:
50             y = conv.col2im_cpu(col, self.sy, self.sx, self.ph, self.pw,
51                                 self.outh, self.outw)
52         return y,
53 
54     def backward(self, x, gy):
55         if isinstance(gy[0], cuda.ndarray):
56             gcol = conv.im2col_gpu(
57                 gy[0], self.kh, self.kw, self.sy, self.sx, self.ph, self.pw,
58                 cover_all=self.cover_all)
59         else:
60             gcol = conv.im2col_cpu(
61                 gy[0], self.kh, self.kw, self.sy, self.sx, self.ph, self.pw,
62                 cover_all=self.cover_all)
63         gx = gcol.sum(axis=(2, 3))
64         return gx,
65 
66 
67 def unpooling_2d(x, ksize, stride=None, pad=0, outsize=None, cover_all=True):
68     """Inverse operation of pooling for 2d array.
69 
70     This function acts similarly to :class:`~functions.Deconvolution2D`, but
71     it spreads input 2d array's value without any parameter instead of
72     computing the inner products.
73 
74     Args:
75         x (~chainer.Variable): Input variable.
76         ksize (int or pair of ints): Size of pooling window. ``ksize=k`` and
77             ``ksize=(k, k)`` are equivalent.
78         stride (int, pair of ints or None): Stride of pooling applications.
79             ``stride=s`` and ``stride=(s, s)`` are equivalent. If ``None`` is
80             specified, then it uses same stride as the pooling window size.
81         pad (int or pair of ints): Spatial padding width for the input array.
82             ``pad=p`` and ``pad=(p, p)`` are equivalent.
83         outsize (None or pair of ints): Expected output size (height, width)
84             of array after the operation.  If ``None``, the size
85             (height or width) is estimated from the size of input array
86             in first batch with
87             :func:`~chainer.utils.conv.get_deconv_outsize`.
88             If outsize is not ``None``, the result of outsize applied to
89             :func:`~chainer.utils.conv.get_conv_outsize` must be equal to
90             the shape of the 2d array in the input batch ``x``.
91         cover_all (bool): If ``True``, all spatial locations are pooled
92             into some output pixels, and the output size is larger than that
93             when cover_all is ``False``.
94 
95     Returns:
96         ~chainer.Variable: Output variable.
97 
98     """
99     return Unpooling2D(ksize, stride, pad, outsize, cover_all)(x)
100
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/chainer/functions/pooling/unpooling_2d.py b/chainer/functions/pooling/unpooling_2d.py
--- a/chainer/functions/pooling/unpooling_2d.py
+++ b/chainer/functions/pooling/unpooling_2d.py
@@ -88,9 +88,12 @@
             If outsize is not ``None``, the result of outsize applied to
             :func:`~chainer.utils.conv.get_conv_outsize` must be equal to
             the shape of the 2d array in the input batch ``x``.
-        cover_all (bool): If ``True``, all spatial locations are pooled
-            into some output pixels, and the output size is larger than that
-            when cover_all is ``False``.
+        cover_all (bool): If ``True``, the output size may be smaller than
+            the size if ``cover_all`` is ``False``. This flag serves to
+            align behavior to the pooling functions which can cover all
+            input locations, see :func:`~chainer.functions.max_pooling_2d`
+            and :func:`~chainer.functions.convolution_2d`.
+
 
     Returns:
         ~chainer.Variable: Output variable.

{"golden_diff": "diff --git a/chainer/functions/pooling/unpooling_2d.py b/chainer/functions/pooling/unpooling_2d.py\n--- a/chainer/functions/pooling/unpooling_2d.py\n+++ b/chainer/functions/pooling/unpooling_2d.py\n@@ -88,9 +88,12 @@\n             If outsize is not ``None``, the result of outsize applied to\n             :func:`~chainer.utils.conv.get_conv_outsize` must be equal to\n             the shape of the 2d array in the input batch ``x``.\n-        cover_all (bool): If ``True``, all spatial locations are pooled\n-            into some output pixels, and the output size is larger than that\n-            when cover_all is ``False``.\n+        cover_all (bool): If ``True``, the output size may be smaller than\n+            the size if ``cover_all`` is ``False``. This flag serves to\n+            align behavior to the pooling functions which can cover all\n+            input locations, see :func:`~chainer.functions.max_pooling_2d`\n+            and :func:`~chainer.functions.convolution_2d`.\n+\n \n     Returns:\n         ~chainer.Variable: Output variable.\n", "issue": "Possibly wrong doc or code for deconvolution cover_all\nThe documentation says:\n\n```\ncover_all (bool): If True, all spatial locations are convoluted into\n            some output pixels. It may make the output size larger.\n```\n\nHowever, when I prepare a small toy example, the output is larger when `cover_all=True`. I feel like either the code or the documentation needs to be inverted.\n\nSee an [gist notebook](https://gist.github.com/LukasDrude/8a9ebbaa3a6ba4ae0e2bef611afefd5a) for the toy example or the attached screenshot. I had set the weight matrices to ones and disabled normalization for clarity.\n\n![screen shot 2016-07-01 at 14 54 08](https://cloud.githubusercontent.com/assets/1886882/16522122/fa0d9554-3f9b-11e6-8f2c-3ea75a9b0a5b.png)\n\n", "before_files": [{"content": "from chainer import cuda\nfrom chainer.functions.pooling import pooling_2d\nfrom chainer.utils import conv\nfrom chainer.utils import type_check\n\n\nclass Unpooling2D(pooling_2d.Pooling2D):\n\n    \"\"\"Unpooling over a set of 2d planes.\"\"\"\n\n    def __init__(self, ksize, stride=None, pad=0,\n                 outsize=None, cover_all=True):\n        super(Unpooling2D, self).__init__(ksize, stride, pad, cover_all)\n        self.outh, self.outw = (None, None) if outsize is None else outsize\n\n    def check_type_forward(self, in_types):\n        n_in = in_types.size()\n        type_check.expect(n_in == 1)\n        x_type = in_types[0]\n\n        type_check.expect(\n            x_type.dtype.kind == 'f',\n            x_type.ndim == 4,\n        )\n\n        if self.outh is not None:\n            expected_h = conv.get_conv_outsize(\n                self.outh, self.kh, self.sy, self.ph, cover_all=self.cover_all)\n            type_check.expect(x_type.shape[2] == expected_h)\n        if self.outw is not None:\n            expected_w = conv.get_conv_outsize(\n                self.outw, self.kw, self.sx, self.pw, cover_all=self.cover_all)\n            type_check.expect(x_type.shape[3] == expected_w)\n\n    def forward(self, x):\n        h, w = x[0].shape[2:]\n        if self.outh is None:\n            self.outh = conv.get_deconv_outsize(\n                h, self.kh, self.sy, self.ph, cover_all=self.cover_all)\n        if self.outw is None:\n            self.outw = conv.get_deconv_outsize(\n                w, self.kw, self.sx, self.pw, cover_all=self.cover_all)\n        xp = cuda.get_array_module(*x)\n        col = xp.tile(x[0][:, :, None, None],\n                      (1, 1, self.kh, self.kw, 1, 1))\n        if isinstance(x[0], cuda.ndarray):\n            y = conv.col2im_gpu(col, self.sy, self.sx, self.ph, self.pw,\n                                self.outh, self.outw)\n        else:\n            y = conv.col2im_cpu(col, self.sy, self.sx, self.ph, self.pw,\n                                self.outh, self.outw)\n        return y,\n\n    def backward(self, x, gy):\n        if isinstance(gy[0], cuda.ndarray):\n            gcol = conv.im2col_gpu(\n                gy[0], self.kh, self.kw, self.sy, self.sx, self.ph, self.pw,\n                cover_all=self.cover_all)\n        else:\n            gcol = conv.im2col_cpu(\n                gy[0], self.kh, self.kw, self.sy, self.sx, self.ph, self.pw,\n                cover_all=self.cover_all)\n        gx = gcol.sum(axis=(2, 3))\n        return gx,\n\n\ndef unpooling_2d(x, ksize, stride=None, pad=0, outsize=None, cover_all=True):\n    \"\"\"Inverse operation of pooling for 2d array.\n\n    This function acts similarly to :class:`~functions.Deconvolution2D`, but\n    it spreads input 2d array's value without any parameter instead of\n    computing the inner products.\n\n    Args:\n        x (~chainer.Variable): Input variable.\n        ksize (int or pair of ints): Size of pooling window. ``ksize=k`` and\n            ``ksize=(k, k)`` are equivalent.\n        stride (int, pair of ints or None): Stride of pooling applications.\n            ``stride=s`` and ``stride=(s, s)`` are equivalent. If ``None`` is\n            specified, then it uses same stride as the pooling window size.\n        pad (int or pair of ints): Spatial padding width for the input array.\n            ``pad=p`` and ``pad=(p, p)`` are equivalent.\n        outsize (None or pair of ints): Expected output size (height, width)\n            of array after the operation.  If ``None``, the size\n            (height or width) is estimated from the size of input array\n            in first batch with\n            :func:`~chainer.utils.conv.get_deconv_outsize`.\n            If outsize is not ``None``, the result of outsize applied to\n            :func:`~chainer.utils.conv.get_conv_outsize` must be equal to\n            the shape of the 2d array in the input batch ``x``.\n        cover_all (bool): If ``True``, all spatial locations are pooled\n            into some output pixels, and the output size is larger than that\n            when cover_all is ``False``.\n\n    Returns:\n        ~chainer.Variable: Output variable.\n\n    \"\"\"\n    return Unpooling2D(ksize, stride, pad, outsize, cover_all)(x)\n", "path": "chainer/functions/pooling/unpooling_2d.py"}], "after_files": [{"content": "from chainer import cuda\nfrom chainer.functions.pooling import pooling_2d\nfrom chainer.utils import conv\nfrom chainer.utils import type_check\n\n\nclass Unpooling2D(pooling_2d.Pooling2D):\n\n    \"\"\"Unpooling over a set of 2d planes.\"\"\"\n\n    def __init__(self, ksize, stride=None, pad=0,\n                 outsize=None, cover_all=True):\n        super(Unpooling2D, self).__init__(ksize, stride, pad, cover_all)\n        self.outh, self.outw = (None, None) if outsize is None else outsize\n\n    def check_type_forward(self, in_types):\n        n_in = in_types.size()\n        type_check.expect(n_in == 1)\n        x_type = in_types[0]\n\n        type_check.expect(\n            x_type.dtype.kind == 'f',\n            x_type.ndim == 4,\n        )\n\n        if self.outh is not None:\n            expected_h = conv.get_conv_outsize(\n                self.outh, self.kh, self.sy, self.ph, cover_all=self.cover_all)\n            type_check.expect(x_type.shape[2] == expected_h)\n        if self.outw is not None:\n            expected_w = conv.get_conv_outsize(\n                self.outw, self.kw, self.sx, self.pw, cover_all=self.cover_all)\n            type_check.expect(x_type.shape[3] == expected_w)\n\n    def forward(self, x):\n        h, w = x[0].shape[2:]\n        if self.outh is None:\n            self.outh = conv.get_deconv_outsize(\n                h, self.kh, self.sy, self.ph, cover_all=self.cover_all)\n        if self.outw is None:\n            self.outw = conv.get_deconv_outsize(\n                w, self.kw, self.sx, self.pw, cover_all=self.cover_all)\n        xp = cuda.get_array_module(*x)\n        col = xp.tile(x[0][:, :, None, None],\n                      (1, 1, self.kh, self.kw, 1, 1))\n        if isinstance(x[0], cuda.ndarray):\n            y = conv.col2im_gpu(col, self.sy, self.sx, self.ph, self.pw,\n                                self.outh, self.outw)\n        else:\n            y = conv.col2im_cpu(col, self.sy, self.sx, self.ph, self.pw,\n                                self.outh, self.outw)\n        return y,\n\n    def backward(self, x, gy):\n        if isinstance(gy[0], cuda.ndarray):\n            gcol = conv.im2col_gpu(\n                gy[0], self.kh, self.kw, self.sy, self.sx, self.ph, self.pw,\n                cover_all=self.cover_all)\n        else:\n            gcol = conv.im2col_cpu(\n                gy[0], self.kh, self.kw, self.sy, self.sx, self.ph, self.pw,\n                cover_all=self.cover_all)\n        gx = gcol.sum(axis=(2, 3))\n        return gx,\n\n\ndef unpooling_2d(x, ksize, stride=None, pad=0, outsize=None, cover_all=True):\n    \"\"\"Inverse operation of pooling for 2d array.\n\n    This function acts similarly to :class:`~functions.Deconvolution2D`, but\n    it spreads input 2d array's value without any parameter instead of\n    computing the inner products.\n\n    Args:\n        x (~chainer.Variable): Input variable.\n        ksize (int or pair of ints): Size of pooling window. ``ksize=k`` and\n            ``ksize=(k, k)`` are equivalent.\n        stride (int, pair of ints or None): Stride of pooling applications.\n            ``stride=s`` and ``stride=(s, s)`` are equivalent. If ``None`` is\n            specified, then it uses same stride as the pooling window size.\n        pad (int or pair of ints): Spatial padding width for the input array.\n            ``pad=p`` and ``pad=(p, p)`` are equivalent.\n        outsize (None or pair of ints): Expected output size (height, width)\n            of array after the operation.  If ``None``, the size\n            (height or width) is estimated from the size of input array\n            in first batch with\n            :func:`~chainer.utils.conv.get_deconv_outsize`.\n            If outsize is not ``None``, the result of outsize applied to\n            :func:`~chainer.utils.conv.get_conv_outsize` must be equal to\n            the shape of the 2d array in the input batch ``x``.\n        cover_all (bool): If ``True``, the output size may be smaller than\n            the size if ``cover_all`` is ``False``. This flag serves to\n            align behavior to the pooling functions which can cover all\n            input locations, see :func:`~chainer.functions.max_pooling_2d`\n            and :func:`~chainer.functions.convolution_2d`.\n\n\n    Returns:\n        ~chainer.Variable: Output variable.\n\n    \"\"\"\n    return Unpooling2D(ksize, stride, pad, outsize, cover_all)(x)\n", "path": "chainer/functions/pooling/unpooling_2d.py"}]}