code: def max(
      x, axis=None, keepdims=False, with_index=False, only_index=False
  ):
      """Reduce the input N-D array `x` along the given `axis` using the max
      operation. The `axis` argument may be a single integer to reduce
      over one axis, a tuple of integers to reduce over multiple axes,
      or ``None`` to reduce over all axes. If `keepdims` is ``True``,
      the output will keep all reduced dimensions with size 1. If
      `with_index` is True, result is a tuple ``(sorted, indices)`` or
      only ``indices`` if `only_index` is True. Setting `only_index` to
      True implies that `with_index` is also True.
  
      .. code-block:: python
  
          import numpy as np
          import nnabla as nn
          import nnabla.functions as F
  
          nn.set_auto_forward(True)
          x = nn.Variable.from_numpy_array(np.random.rand(2, 3, 4))
  
          maxval = F.max(x, axis=1)
          assert np.allclose(maxval.d, np.max(x.d, axis=1))
  
          maxval, indices = F.max(x, axis=1, with_index=True)
          assert np.allclose(maxval.d, np.max(x.d, axis=1))
          assert np.all(indices.d == np.argmax(x.d, axis=1))
  
          indices = F.max(x, axis=1, only_index=True)
          assert np.all(indices.d == np.argmax(x.d, axis=1))
  
      Args:
          x (Variable): An input variable.
          axis (None, int or tuple of ints): Axis or axes along which max is
              calculated. The default value `None` will reduce all dimensions.
          keepdims(bool): Keep reduced axes as dimension with 1 element.
          with_index(bool): Return tuple of max values and index.
          only_index(bool): Return only the index of max values.
  
      Returns:
          ~nnabla.Variable: N-D array.
  
      """
      from .function_bases import max as max_base
  
      if axis is None:
          axis = range(x.ndim)
      elif not hasattr(axis, "__iter__"):
          axis = [axis]
      n_outputs = 2 if with_index and not only_index else 1
      return max_base(
          x, axis, keepdims, with_index, only_index, n_outputs
      )
  
imports: from __future__ import absolute_import
  from .function_bases import *
  from .None import dtypes
  import nnabla
  import numpy
  from .normalization_functions import *
  from .numpy_compat_functions import *
label_desc: Use image node_id 3 for calling a global function with example usage: max(x, axis, keepdims, with_index, only_index) and returns: max_base