prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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.
  
  </issue>
  <code>
  [start of cupy/logic/truth.py]
  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 of cupy/logic/truth.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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)
  
verification_info: {"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"}]}