We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Different behaviour of argmax
I found the behaviour of `argmax` is different between `numpy` and `cupy` if the array has `0` in its shape and `axis` argument is used. I don't know whether this behaviour is intended or not.

```
np.empty((0, 1)).argmax(axis=1)  # array([], dtype=int64)
cupy.empty((0, 1)).argmax(axis=1)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-a5737d72bcba> in <module>()
----> 1 cupy.empty((0, 1)).argmax(axis=1)

cupy/core/core.pyx in cupy.core.core.ndarray.argmax (cupy/core/core.cpp:17701)()

cupy/core/core.pyx in cupy.core.core.ndarray.argmax (cupy/core/core.cpp:17556)()

cupy/core/reduction.pxi in cupy.core.core.simple_reduction_function.__call__ (cupy/core/core.cpp:52697)()

ValueError: zero-size array to reduction operation cupy_argmax which has no identity
```

I used cupy 2.0.0a1.

--- 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/logic/truth.py`
Content:
```
1 def all(a, axis=None, out=None, keepdims=False):
2     # TODO(okuta): check type
3     return a.all(axis=axis, out=out, keepdims=keepdims)
4 
5 
6 def any(a, axis=None, out=None, keepdims=False):
7     # TODO(okuta): check type
8     return a.any(axis=axis, out=out, keepdims=keepdims)
9
```
--- 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/logic/truth.py b/cupy/logic/truth.py
--- a/cupy/logic/truth.py
+++ b/cupy/logic/truth.py
@@ -1,8 +1,11 @@
+import cupy
+
+
 def all(a, axis=None, out=None, keepdims=False):
-    # TODO(okuta): check type
+    assert isinstance(a, cupy.ndarray)
     return a.all(axis=axis, out=out, keepdims=keepdims)
 
 
 def any(a, axis=None, out=None, keepdims=False):
-    # TODO(okuta): check type
+    assert isinstance(a, cupy.ndarray)
     return a.any(axis=axis, out=out, keepdims=keepdims)

{"golden_diff": "diff --git a/cupy/logic/truth.py b/cupy/logic/truth.py\n--- a/cupy/logic/truth.py\n+++ b/cupy/logic/truth.py\n@@ -1,8 +1,11 @@\n+import cupy\n+\n+\n def all(a, axis=None, out=None, keepdims=False):\n-    # TODO(okuta): check type\n+    assert isinstance(a, cupy.ndarray)\n     return a.all(axis=axis, out=out, keepdims=keepdims)\n \n \n def any(a, axis=None, out=None, keepdims=False):\n-    # TODO(okuta): check type\n+    assert isinstance(a, cupy.ndarray)\n     return a.any(axis=axis, out=out, keepdims=keepdims)\n", "issue": "Different behaviour of argmax\nI found the behaviour of `argmax` is different between `numpy` and `cupy` if the array has `0` in its shape and `axis` argument is used. I don't know whether this behaviour is intended or not.\r\n\r\n```\r\nnp.empty((0, 1)).argmax(axis=1)  # array([], dtype=int64)\r\ncupy.empty((0, 1)).argmax(axis=1)\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-9-a5737d72bcba> in <module>()\r\n----> 1 cupy.empty((0, 1)).argmax(axis=1)\r\n\r\ncupy/core/core.pyx in cupy.core.core.ndarray.argmax (cupy/core/core.cpp:17701)()\r\n\r\ncupy/core/core.pyx in cupy.core.core.ndarray.argmax (cupy/core/core.cpp:17556)()\r\n\r\ncupy/core/reduction.pxi in cupy.core.core.simple_reduction_function.__call__ (cupy/core/core.cpp:52697)()\r\n\r\nValueError: zero-size array to reduction operation cupy_argmax which has no identity\r\n```\r\n\r\nI used cupy 2.0.0a1.\n", "before_files": [{"content": "def all(a, axis=None, out=None, keepdims=False):\n    # TODO(okuta): check type\n    return a.all(axis=axis, out=out, keepdims=keepdims)\n\n\ndef any(a, axis=None, out=None, keepdims=False):\n    # TODO(okuta): check type\n    return a.any(axis=axis, out=out, keepdims=keepdims)\n", "path": "cupy/logic/truth.py"}], "after_files": [{"content": "import cupy\n\n\ndef all(a, axis=None, out=None, keepdims=False):\n    assert isinstance(a, cupy.ndarray)\n    return a.all(axis=axis, out=out, keepdims=keepdims)\n\n\ndef any(a, axis=None, out=None, keepdims=False):\n    assert isinstance(a, cupy.ndarray)\n    return a.any(axis=axis, out=out, keepdims=keepdims)\n", "path": "cupy/logic/truth.py"}]}