We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
default type of `full`is int in numpy but float in cupy
```python
In [53]: np.full((2,2), -1)
Out[53]:
array([[-1, -1],
       [-1, -1]])

In [54]: cp.full((2,2), -1)
Out[54]:
array([[-1., -1.],
       [-1., -1.]])

In [55]: cp.full((2,2), -1, dtype=int)
Out[55]:
array([[-1, -1],
       [-1, -1]])
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `cupy/creation/basic.py`
Content:
```
1 import cupy
2 
3 
4 def empty(shape, dtype=float, order='C'):
5     """Returns an array without initializing the elements.
6 
7     Args:
8         shape (tuple of ints): Dimensionalities of the array.
9         dtype: Data type specifier.
10         order ({'C', 'F'}): Row-major (C-style) or column-major
11             (Fortran-style) order.
12 
13     Returns:
14         cupy.ndarray: A new array with elements not initialized.
15 
16     .. seealso:: :func:`numpy.empty`
17 
18     """
19     return cupy.ndarray(shape, dtype=dtype, order=order)
20 
21 
22 def empty_like(a, dtype=None):
23     """Returns a new array with same shape and dtype of a given array.
24 
25     This function currently does not support ``order`` and ``subok`` options.
26 
27     Args:
28         a (cupy.ndarray): Base array.
29         dtype: Data type specifier. The data type of ``a`` is used by default.
30 
31     Returns:
32         cupy.ndarray: A new array with same shape and dtype of ``a`` with
33         elements not initialized.
34 
35     .. seealso:: :func:`numpy.empty_like`
36 
37     """
38     # TODO(beam2d): Support ordering option
39     if dtype is None:
40         dtype = a.dtype
41     return cupy.ndarray(a.shape, dtype=dtype)
42 
43 
44 def eye(N, M=None, k=0, dtype=float):
45     """Returns a 2-D array with ones on the diagonals and zeros elsewhere.
46 
47     Args:
48         N (int): Number of rows.
49         M (int): Number of columns. M == N by default.
50         k (int): Index of the diagonal. Zero indicates the main diagonal,
51             a positive index an upper diagonal, and a negative index a lower
52             diagonal.
53         dtype: Data type specifier.
54 
55     Returns:
56         cupy.ndarray: A 2-D array with given diagonals filled with ones and
57         zeros elsewhere.
58 
59     .. seealso:: :func:`numpy.eye`
60 
61     """
62     if M is None:
63         M = N
64     ret = zeros((N, M), dtype)
65     ret.diagonal(k)[:] = 1
66     return ret
67 
68 
69 def identity(n, dtype=float):
70     """Returns a 2-D identity array.
71 
72     It is equivalent to ``eye(n, n, dtype)``.
73 
74     Args:
75         n (int): Number of rows and columns.
76         dtype: Data type specifier.
77 
78     Returns:
79         cupy.ndarray: A 2-D identity array.
80 
81     .. seealso:: :func:`numpy.identity`
82 
83     """
84     return eye(n, dtype=dtype)
85 
86 
87 def ones(shape, dtype=float):
88     """Returns a new array of given shape and dtype, filled with ones.
89 
90     This function currently does not support ``order`` option.
91 
92     Args:
93         shape (tuple of ints): Dimensionalities of the array.
94         dtype: Data type specifier.
95 
96     Returns:
97         cupy.ndarray: An array filled with ones.
98 
99     .. seealso:: :func:`numpy.ones`
100 
101     """
102     # TODO(beam2d): Support ordering option
103     a = cupy.ndarray(shape, dtype=dtype)
104     a.fill(1)
105     return a
106 
107 
108 def ones_like(a, dtype=None):
109     """Returns an array of ones with same shape and dtype as a given array.
110 
111     This function currently does not support ``order`` and ``subok`` options.
112 
113     Args:
114         a (cupy.ndarray): Base array.
115         dtype: Data type specifier. The dtype of ``a`` is used by default.
116 
117     Returns:
118         cupy.ndarray: An array filled with ones.
119 
120     .. seealso:: :func:`numpy.ones_like`
121 
122     """
123     # TODO(beam2d): Support ordering option
124     if dtype is None:
125         dtype = a.dtype
126     a = cupy.ndarray(a.shape, dtype=dtype)
127     a.fill(1)
128     return a
129 
130 
131 def zeros(shape, dtype=float, order='C'):
132     """Returns a new array of given shape and dtype, filled with zeros.
133 
134     Args:
135         shape (tuple of ints): Dimensionalities of the array.
136         dtype: Data type specifier.
137         order ({'C', 'F'}): Row-major (C-style) or column-major
138             (Fortran-style) order.
139 
140     Returns:
141         cupy.ndarray: An array filled with ones.
142 
143     .. seealso:: :func:`numpy.zeros`
144 
145     """
146     a = cupy.ndarray(shape, dtype, order=order)
147     a.data.memset_async(0, a.nbytes)
148     return a
149 
150 
151 def zeros_like(a, dtype=None):
152     """Returns an array of zeros with same shape and dtype as a given array.
153 
154     This function currently does not support ``order`` and ``subok`` options.
155 
156     Args:
157         a (cupy.ndarray): Base array.
158         dtype: Data type specifier. The dtype of ``a`` is used by default.
159 
160     Returns:
161         cupy.ndarray: An array filled with ones.
162 
163     .. seealso:: :func:`numpy.zeros_like`
164 
165     """
166     # TODO(beam2d): Support ordering option
167     if dtype is None:
168         dtype = a.dtype
169     a = cupy.ndarray(a.shape, dtype)
170     a.data.memset_async(0, a.nbytes)
171     return a
172 
173 
174 def full(shape, fill_value, dtype=None):
175     """Returns a new array of given shape and dtype, filled with a given value.
176 
177     This function currently does not support ``order`` option.
178 
179     Args:
180         shape (tuple of ints): Dimensionalities of the array.
181         fill_value: A scalar value to fill a new array.
182         dtype: Data type specifier.
183 
184     Returns:
185         cupy.ndarray: An array filled with ``fill_value``.
186 
187     .. seealso:: :func:`numpy.full`
188 
189     """
190     # TODO(beam2d): Support ordering option
191     a = cupy.ndarray(shape, dtype=dtype)
192     a.fill(fill_value)
193     return a
194 
195 
196 def full_like(a, fill_value, dtype=None):
197     """Returns a full array with same shape and dtype as a given array.
198 
199     This function currently does not support ``order`` and ``subok`` options.
200 
201     Args:
202         a (cupy.ndarray): Base array.
203         fill_value: A scalar value to fill a new array.
204         dtype: Data type specifier. The dtype of ``a`` is used by default.
205 
206     Returns:
207         cupy.ndarray: An array filled with ``fill_value``.
208 
209     .. seealso:: :func:`numpy.full_like`
210 
211     """
212     # TODO(beam2d): Support ordering option
213     if dtype is None:
214         dtype = a.dtype
215     a = cupy.ndarray(a.shape, dtype=dtype)
216     a.fill(fill_value)
217     return a
218
```
--- 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/cupy/creation/basic.py b/cupy/creation/basic.py
--- a/cupy/creation/basic.py
+++ b/cupy/creation/basic.py
@@ -1,4 +1,5 @@
 import cupy
+import numpy
 
 
 def empty(shape, dtype=float, order='C'):
@@ -188,6 +189,11 @@
 
     """
     # TODO(beam2d): Support ordering option
+    if dtype is None:
+        if isinstance(fill_value, cupy.ndarray):
+            dtype = fill_value.dtype
+        else:
+            dtype = numpy.array(fill_value).dtype
     a = cupy.ndarray(shape, dtype=dtype)
     a.fill(fill_value)
     return a

{"golden_diff": "diff --git a/cupy/creation/basic.py b/cupy/creation/basic.py\n--- a/cupy/creation/basic.py\n+++ b/cupy/creation/basic.py\n@@ -1,4 +1,5 @@\n import cupy\n+import numpy\n \n \n def empty(shape, dtype=float, order='C'):\n@@ -188,6 +189,11 @@\n \n     \"\"\"\n     # TODO(beam2d): Support ordering option\n+    if dtype is None:\n+        if isinstance(fill_value, cupy.ndarray):\n+            dtype = fill_value.dtype\n+        else:\n+            dtype = numpy.array(fill_value).dtype\n     a = cupy.ndarray(shape, dtype=dtype)\n     a.fill(fill_value)\n     return a\n", "issue": "default type of `full`is int in numpy but float in cupy\n```python\r\nIn [53]: np.full((2,2), -1)\r\nOut[53]:\r\narray([[-1, -1],\r\n       [-1, -1]])\r\n\r\nIn [54]: cp.full((2,2), -1)\r\nOut[54]:\r\narray([[-1., -1.],\r\n       [-1., -1.]])\r\n\r\nIn [55]: cp.full((2,2), -1, dtype=int)\r\nOut[55]:\r\narray([[-1, -1],\r\n       [-1, -1]])\r\n```\n", "before_files": [{"content": "import cupy\n\n\ndef empty(shape, dtype=float, order='C'):\n    \"\"\"Returns an array without initializing the elements.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        dtype: Data type specifier.\n        order ({'C', 'F'}): Row-major (C-style) or column-major\n            (Fortran-style) order.\n\n    Returns:\n        cupy.ndarray: A new array with elements not initialized.\n\n    .. seealso:: :func:`numpy.empty`\n\n    \"\"\"\n    return cupy.ndarray(shape, dtype=dtype, order=order)\n\n\ndef empty_like(a, dtype=None):\n    \"\"\"Returns a new array with same shape and dtype of a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        dtype: Data type specifier. The data type of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: A new array with same shape and dtype of ``a`` with\n        elements not initialized.\n\n    .. seealso:: :func:`numpy.empty_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    return cupy.ndarray(a.shape, dtype=dtype)\n\n\ndef eye(N, M=None, k=0, dtype=float):\n    \"\"\"Returns a 2-D array with ones on the diagonals and zeros elsewhere.\n\n    Args:\n        N (int): Number of rows.\n        M (int): Number of columns. M == N by default.\n        k (int): Index of the diagonal. Zero indicates the main diagonal,\n            a positive index an upper diagonal, and a negative index a lower\n            diagonal.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: A 2-D array with given diagonals filled with ones and\n        zeros elsewhere.\n\n    .. seealso:: :func:`numpy.eye`\n\n    \"\"\"\n    if M is None:\n        M = N\n    ret = zeros((N, M), dtype)\n    ret.diagonal(k)[:] = 1\n    return ret\n\n\ndef identity(n, dtype=float):\n    \"\"\"Returns a 2-D identity array.\n\n    It is equivalent to ``eye(n, n, dtype)``.\n\n    Args:\n        n (int): Number of rows and columns.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: A 2-D identity array.\n\n    .. seealso:: :func:`numpy.identity`\n\n    \"\"\"\n    return eye(n, dtype=dtype)\n\n\ndef ones(shape, dtype=float):\n    \"\"\"Returns a new array of given shape and dtype, filled with ones.\n\n    This function currently does not support ``order`` option.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.ones`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    a = cupy.ndarray(shape, dtype=dtype)\n    a.fill(1)\n    return a\n\n\ndef ones_like(a, dtype=None):\n    \"\"\"Returns an array of ones with same shape and dtype as a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        dtype: Data type specifier. The dtype of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.ones_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    a = cupy.ndarray(a.shape, dtype=dtype)\n    a.fill(1)\n    return a\n\n\ndef zeros(shape, dtype=float, order='C'):\n    \"\"\"Returns a new array of given shape and dtype, filled with zeros.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        dtype: Data type specifier.\n        order ({'C', 'F'}): Row-major (C-style) or column-major\n            (Fortran-style) order.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.zeros`\n\n    \"\"\"\n    a = cupy.ndarray(shape, dtype, order=order)\n    a.data.memset_async(0, a.nbytes)\n    return a\n\n\ndef zeros_like(a, dtype=None):\n    \"\"\"Returns an array of zeros with same shape and dtype as a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        dtype: Data type specifier. The dtype of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.zeros_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    a = cupy.ndarray(a.shape, dtype)\n    a.data.memset_async(0, a.nbytes)\n    return a\n\n\ndef full(shape, fill_value, dtype=None):\n    \"\"\"Returns a new array of given shape and dtype, filled with a given value.\n\n    This function currently does not support ``order`` option.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        fill_value: A scalar value to fill a new array.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: An array filled with ``fill_value``.\n\n    .. seealso:: :func:`numpy.full`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    a = cupy.ndarray(shape, dtype=dtype)\n    a.fill(fill_value)\n    return a\n\n\ndef full_like(a, fill_value, dtype=None):\n    \"\"\"Returns a full array with same shape and dtype as a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        fill_value: A scalar value to fill a new array.\n        dtype: Data type specifier. The dtype of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: An array filled with ``fill_value``.\n\n    .. seealso:: :func:`numpy.full_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    a = cupy.ndarray(a.shape, dtype=dtype)\n    a.fill(fill_value)\n    return a\n", "path": "cupy/creation/basic.py"}], "after_files": [{"content": "import cupy\nimport numpy\n\n\ndef empty(shape, dtype=float, order='C'):\n    \"\"\"Returns an array without initializing the elements.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        dtype: Data type specifier.\n        order ({'C', 'F'}): Row-major (C-style) or column-major\n            (Fortran-style) order.\n\n    Returns:\n        cupy.ndarray: A new array with elements not initialized.\n\n    .. seealso:: :func:`numpy.empty`\n\n    \"\"\"\n    return cupy.ndarray(shape, dtype=dtype, order=order)\n\n\ndef empty_like(a, dtype=None):\n    \"\"\"Returns a new array with same shape and dtype of a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        dtype: Data type specifier. The data type of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: A new array with same shape and dtype of ``a`` with\n        elements not initialized.\n\n    .. seealso:: :func:`numpy.empty_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    return cupy.ndarray(a.shape, dtype=dtype)\n\n\ndef eye(N, M=None, k=0, dtype=float):\n    \"\"\"Returns a 2-D array with ones on the diagonals and zeros elsewhere.\n\n    Args:\n        N (int): Number of rows.\n        M (int): Number of columns. M == N by default.\n        k (int): Index of the diagonal. Zero indicates the main diagonal,\n            a positive index an upper diagonal, and a negative index a lower\n            diagonal.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: A 2-D array with given diagonals filled with ones and\n        zeros elsewhere.\n\n    .. seealso:: :func:`numpy.eye`\n\n    \"\"\"\n    if M is None:\n        M = N\n    ret = zeros((N, M), dtype)\n    ret.diagonal(k)[:] = 1\n    return ret\n\n\ndef identity(n, dtype=float):\n    \"\"\"Returns a 2-D identity array.\n\n    It is equivalent to ``eye(n, n, dtype)``.\n\n    Args:\n        n (int): Number of rows and columns.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: A 2-D identity array.\n\n    .. seealso:: :func:`numpy.identity`\n\n    \"\"\"\n    return eye(n, dtype=dtype)\n\n\ndef ones(shape, dtype=float):\n    \"\"\"Returns a new array of given shape and dtype, filled with ones.\n\n    This function currently does not support ``order`` option.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.ones`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    a = cupy.ndarray(shape, dtype=dtype)\n    a.fill(1)\n    return a\n\n\ndef ones_like(a, dtype=None):\n    \"\"\"Returns an array of ones with same shape and dtype as a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        dtype: Data type specifier. The dtype of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.ones_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    a = cupy.ndarray(a.shape, dtype=dtype)\n    a.fill(1)\n    return a\n\n\ndef zeros(shape, dtype=float, order='C'):\n    \"\"\"Returns a new array of given shape and dtype, filled with zeros.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        dtype: Data type specifier.\n        order ({'C', 'F'}): Row-major (C-style) or column-major\n            (Fortran-style) order.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.zeros`\n\n    \"\"\"\n    a = cupy.ndarray(shape, dtype, order=order)\n    a.data.memset_async(0, a.nbytes)\n    return a\n\n\ndef zeros_like(a, dtype=None):\n    \"\"\"Returns an array of zeros with same shape and dtype as a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        dtype: Data type specifier. The dtype of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: An array filled with ones.\n\n    .. seealso:: :func:`numpy.zeros_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    a = cupy.ndarray(a.shape, dtype)\n    a.data.memset_async(0, a.nbytes)\n    return a\n\n\ndef full(shape, fill_value, dtype=None):\n    \"\"\"Returns a new array of given shape and dtype, filled with a given value.\n\n    This function currently does not support ``order`` option.\n\n    Args:\n        shape (tuple of ints): Dimensionalities of the array.\n        fill_value: A scalar value to fill a new array.\n        dtype: Data type specifier.\n\n    Returns:\n        cupy.ndarray: An array filled with ``fill_value``.\n\n    .. seealso:: :func:`numpy.full`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        if isinstance(fill_value, cupy.ndarray):\n            dtype = fill_value.dtype\n        else:\n            dtype = numpy.array(fill_value).dtype\n    a = cupy.ndarray(shape, dtype=dtype)\n    a.fill(fill_value)\n    return a\n\n\ndef full_like(a, fill_value, dtype=None):\n    \"\"\"Returns a full array with same shape and dtype as a given array.\n\n    This function currently does not support ``order`` and ``subok`` options.\n\n    Args:\n        a (cupy.ndarray): Base array.\n        fill_value: A scalar value to fill a new array.\n        dtype: Data type specifier. The dtype of ``a`` is used by default.\n\n    Returns:\n        cupy.ndarray: An array filled with ``fill_value``.\n\n    .. seealso:: :func:`numpy.full_like`\n\n    \"\"\"\n    # TODO(beam2d): Support ordering option\n    if dtype is None:\n        dtype = a.dtype\n    a = cupy.ndarray(a.shape, dtype=dtype)\n    a.fill(fill_value)\n    return a\n", "path": "cupy/creation/basic.py"}]}