code: def test_arg_reduction():
      argmax = lambda x, *args, **kwargs: tile(
          x.argmax(*args, **kwargs)
      )
      argmin = lambda x, *args, **kwargs: tile(
          x.argmin(*args, **kwargs)
      )
  
      res1 = argmax(ones((10, 8, 10), chunk_size=3))
      res2 = argmin(ones((10, 8, 10), chunk_size=3))
      assert res1.shape == ()
      assert res1.dtype is not None
      assert res2.shape == ()
      assert isinstance(res1.chunks[0].op, TensorArgmax)
      assert res1.chunks[0].op.stage == OperandStage.agg
      assert isinstance(res2.chunks[0].op, TensorArgmin)
      assert res2.chunks[0].op.stage == OperandStage.agg
      assert isinstance(res1.chunks[0].inputs[0].op, TensorConcatenate)
      assert isinstance(res2.chunks[0].inputs[0].op, TensorConcatenate)
      assert isinstance(
          res1.chunks[0].inputs[0].inputs[0].op, TensorArgmax
      )
      assert (
          res1.chunks[0].inputs[0].inputs[0].op.stage
          == OperandStage.combine
      )
      assert isinstance(
          res2.chunks[0].inputs[0].inputs[0].op, TensorArgmin
      )
      assert (
          res2.chunks[0].inputs[0].inputs[0].op.stage
          == OperandStage.combine
      )
  
      res1 = argmax(ones((10, 8), chunk_size=3), axis=1)
      res2 = argmin(ones((10, 8), chunk_size=3), axis=1)
      assert res1.shape == (10,)
      assert res2.shape == (10,)
      assert isinstance(res1.chunks[0].op, TensorArgmax)
      assert res1.chunks[0].op.stage == OperandStage.agg
      assert isinstance(res2.chunks[0].op, TensorArgmin)
      assert res2.chunks[0].op.stage == OperandStage.agg
      assert isinstance(res1.chunks[0].inputs[0].op, TensorConcatenate)
      assert isinstance(res2.chunks[0].inputs[0].op, TensorConcatenate)
      assert isinstance(
          res1.chunks[0].inputs[0].inputs[0].op, TensorArgmax
      )
      assert (
          res1.chunks[0].inputs[0].inputs[0].op.stage
          == OperandStage.map
      )
      assert isinstance(
          res2.chunks[0].inputs[0].inputs[0].op, TensorArgmin
      )
      assert (
          res2.chunks[0].inputs[0].inputs[0].op.stage
          == OperandStage.map
      )
  
      pytest.raises(
          TypeError,
          lambda: argmax(ones((10, 8, 10), chunk_size=3), axis=(0, 1)),
      )
      pytest.raises(
          TypeError,
          lambda: argmin(ones((10, 8, 10), chunk_size=3), axis=(0, 1)),
      )
      pytest.raises(
          np.AxisError,
          lambda: argmin(ones((10, 8, 10), chunk_size=3), axis=3),
      )
      pytest.raises(
          np.AxisError,
          lambda: argmin(ones((10, 8, 10), chunk_size=3), axis=-4),
      )
  
file_path: mars/mars/tensor/reduction/tests/test_reduction.py
imports: import numpy
  import pytest
  from ....core import tile
  from ....core.operand import OperandStage
  from ...datasource import ones, tensor
  from ...merge import TensorConcatenate
  from ..None import all, TensorMean, TensorArgmax, TensorArgmin
label_desc: Use image node_id 3 for calling a global function with example usage: test_arg_reduction() without return types