We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add type check to Parameter function
Related to #123 


--- 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/parameter.py`
Content:
```
1 import numpy
2 
3 from chainer import function
4 
5 
6 class Parameter(function.Function):
7 
8     """Function that outputs its weight array.
9 
10     This is a parameterized function that takes no input and returns a variable
11     holding a shallow copy of the parameter array.
12 
13     Args:
14         array: Initial parameter array.
15 
16     """
17     parameter_names = 'W',
18     gradient_names = 'gW',
19 
20     def __init__(self, array):
21         self.W = array
22         self.gW = numpy.empty_like(array)
23 
24     def forward(self, x):
25         return self.W,
26 
27     def backward(self, x, gy):
28         self.gW += gy[0]
29         return ()
30
```
--- 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/parameter.py b/chainer/functions/parameter.py
--- a/chainer/functions/parameter.py
+++ b/chainer/functions/parameter.py
@@ -1,6 +1,7 @@
 import numpy
 
 from chainer import function
+from chainer.utils import type_check
 
 
 class Parameter(function.Function):
@@ -21,6 +22,9 @@
         self.W = array
         self.gW = numpy.empty_like(array)
 
+    def check_type_forward(self, in_types):
+        type_check.expect(in_types.size() == 0)
+
     def forward(self, x):
         return self.W,

{"golden_diff": "diff --git a/chainer/functions/parameter.py b/chainer/functions/parameter.py\n--- a/chainer/functions/parameter.py\n+++ b/chainer/functions/parameter.py\n@@ -1,6 +1,7 @@\n import numpy\n \n from chainer import function\n+from chainer.utils import type_check\n \n \n class Parameter(function.Function):\n@@ -21,6 +22,9 @@\n         self.W = array\n         self.gW = numpy.empty_like(array)\n \n+    def check_type_forward(self, in_types):\n+        type_check.expect(in_types.size() == 0)\n+\n     def forward(self, x):\n         return self.W,\n", "issue": "Add type check to Parameter function\nRelated to #123 \n\n", "before_files": [{"content": "import numpy\n\nfrom chainer import function\n\n\nclass Parameter(function.Function):\n\n    \"\"\"Function that outputs its weight array.\n\n    This is a parameterized function that takes no input and returns a variable\n    holding a shallow copy of the parameter array.\n\n    Args:\n        array: Initial parameter array.\n\n    \"\"\"\n    parameter_names = 'W',\n    gradient_names = 'gW',\n\n    def __init__(self, array):\n        self.W = array\n        self.gW = numpy.empty_like(array)\n\n    def forward(self, x):\n        return self.W,\n\n    def backward(self, x, gy):\n        self.gW += gy[0]\n        return ()\n", "path": "chainer/functions/parameter.py"}], "after_files": [{"content": "import numpy\n\nfrom chainer import function\nfrom chainer.utils import type_check\n\n\nclass Parameter(function.Function):\n\n    \"\"\"Function that outputs its weight array.\n\n    This is a parameterized function that takes no input and returns a variable\n    holding a shallow copy of the parameter array.\n\n    Args:\n        array: Initial parameter array.\n\n    \"\"\"\n    parameter_names = 'W',\n    gradient_names = 'gW',\n\n    def __init__(self, array):\n        self.W = array\n        self.gW = numpy.empty_like(array)\n\n    def check_type_forward(self, in_types):\n        type_check.expect(in_types.size() == 0)\n\n    def forward(self, x):\n        return self.W,\n\n    def backward(self, x, gy):\n        self.gW += gy[0]\n        return ()\n", "path": "chainer/functions/parameter.py"}]}