code: def _docs_creation():
      _docs.set_doc(
          chainerx.empty,
          """empty(shape, dtype, device=None)
  Returns an array without initializing the elements.
  
  Args:
      shape (tuple of ints): Shape of the array.
      dtype: Data type of the array.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      :class:`~chainerx.ndarray`: New array with elements not initialized.
  
  .. seealso:: :func:`numpy.empty`
  """,
      )
  
      _docs.set_doc(
          chainerx.empty_like,
          """empty_like(a, device=None)
  Returns a new array with same shape and dtype of a given array.
  
  Args:
      a (~chainerx.ndarray): Prototype array.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      :class:`~chainerx.ndarray`: New array with same shape and dtype as ``a`` \
  with elements not initialized.
  
  Warning:
      If ``device`` argument is omitted, the new array is created on the default
      device, not the device of the prototype array.
  
  .. seealso:: :func:`numpy.empty_like`
  """,
      )
  
      _docs.set_doc(
          chainerx.eye,
          """eye(N, M=None, k=0, dtype=float64, device=None)
  Returns a 2-D array with ones on the diagonals and zeros elsewhere.
  
  Args:
      N (int): Number of rows.
      M (int): Number of columns. M == N by default.
      k (int): Index of the diagonal. Zero indicates the main diagonal,
          a positive index an upper diagonal, and a negative index a lower
          diagonal.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: A 2-D array with given diagonals filled with ones and
      zeros elsewhere.
  
  .. seealso:: :func:`numpy.eye`
  """,
      )
  
      _docs.set_doc(
          chainerx.tri,
          """tri(N, M=None, k=0, dtype=float32, device=None)
  Returns a 2-D array with ones at and below the given diagonal
  and zeros elsewhere.
  
  Args:
      N (int): Number of rows.
      M (int): Number of columns. M == N by default.
      k (int): Index of the diagonal. Zero indicates the main diagonal,
          a positive index an upper diagonal, and a negative index a lower
          diagonal.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: A 2-D array with given diagonals filled ones at and
      below the given diagonal and zeros elsewhere.
  
  .. seealso:: :func:`numpy.tri`
  """,
      )
  
      _docs.set_doc(
          chainerx.tril,
          """tril(m, k=0)
  Lower triangle of an array.
  
  Returns a copy of an array with elements above the k-th diagonal zeroed.
  
  Args:
      m (~chainerx.ndarray): Input array.
      k (int): Index of the diagonal. Zero indicates the main diagonal,
          a positive index an upper diagonal, and a negative index a lower
          diagonal.
  
  Returns:
      ~chainerx.ndarray: Lower triangle of ``m``.
  
  .. seealso:: :func:`numpy.tril`
  """,
      )
  
      _docs.set_doc(
          chainerx.triu,
          """triu(m, k=0)
  Upper triangle of an array.
  
  Returns a copy of an array with elements below the k-th diagonal zeroed.
  
  Args:
      m (~chainerx.ndarray): Input array.
      k (int): Index of the diagonal. Zero indicates the main diagonal,
          a positive index an upper diagonal, and a negative index a lower
          diagonal.
  
  Returns:
      ~chainerx.ndarray: Upper triangle of ``m``.
  
  .. seealso:: :func:`numpy.triu`
  """,
      )
  
      _docs.set_doc(
          chainerx.identity,
          """identity(n, dtype=None, device=None)
  Returns a 2-D identity array.
  
  It is equivalent to ``eye(n, n, dtype)``.
  
  Args:
      n (int): Number of rows and columns.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: A 2-D identity array.
  
  .. seealso:: :func:`numpy.identity`
  """,
      )
  
      _docs.set_doc(
          chainerx.ones,
          """ones(shape, dtype, device=None)
  Returns a new array of given shape and dtype, filled with ones.
  
  Args:
      shape (tuple of ints): Shape of the array.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: New array.
  
  .. seealso:: :func:`numpy.ones`
  """,
      )
  
      _docs.set_doc(
          chainerx.ones_like,
          """ones_like(a, device=None)
  Returns an array of ones with same shape and dtype as a given array.
  
  Args:
      a (~chainerx.ndarray): Prototype array.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: New array.
  
  Warning:
      If ``device`` argument is omitted, the new array is created on the default
      device, not the device of the prototype array.
  
  .. seealso:: :func:`numpy.ones_like`
  """,
      )
  
      _docs.set_doc(
          chainerx.zeros,
          """zeros(shape, dtype, device=None)
  Returns a new array of given shape and dtype, filled with zeros.
  
  Args:
      shape (tuple of ints): Shape of the array.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: New array.
  
  .. seealso:: :func:`numpy.zeros`
  """,
      )
  
      _docs.set_doc(
          chainerx.zeros_like,
          """zeros_like(a, device=None)
  Returns an array of zeros with same shape and dtype as a given array.
  
  Args:
      a (~chainerx.ndarray): Prototype array.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: New array.
  
  Warning:
      If ``device`` argument is omitted, the new array is created on the default
      device, not the device of the prototype array.
  
  .. seealso:: :func:`numpy.zeros_like`
  """,
      )
  
      _docs.set_doc(
          chainerx.full,
          """full(shape, fill_value, dtype, device=None)
  Returns a new array of given shape and dtype, filled with a given value.
  
  Args:
      shape (tuple of ints): Shape of the array.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: New array.
  
  .. seealso:: :func:`numpy.full`
  """,
      )
  
      _docs.set_doc(
          chainerx.full_like,
          """full_like(a, fill_value, dtype=None, device=None)
  Returns a full array with same shape and dtype as a given array.
  
  Args:
      a (~chainerx.ndarray): Prototype array.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: New array.
  
  Warning:
      If ``device`` argument is omitted, the new array is created on the default
      device, not the device of the prototype array.
  
  .. seealso:: :func:`numpy.full_like`
  """,
      )
  
      _docs.set_doc(
          chainerx.array,
          """array(object, dtype=None, copy=True, device=None)
  Creates an array.
  
  Args:
      object: A :class:`~chainerx.ndarray` object or any other object that can be
          passed to :func:`numpy.array`.
      dtype: Data type. If omitted, it's inferred from the input.
      copy (bool): If ``True``, the object is always copied. Otherwise, a copy
          will only be made if it is needed to satisfy any of the other
          requirements (dtype, device, etc.).
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: New array.
  
  Warning:
      If ``device`` argument is omitted, the new array is created on the default
      device, not the device of the input array.
  
  .. seealso:: :func:`numpy.array`
  """,
      )
  
      _docs.set_doc(
          chainerx.asarray,
          """asarray(a, dtype=None, device=None)
  Converts an object to an array.
  
  Args:
      a: The source object.
      dtype: Data type. If omitted, it's inferred from the input.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: Array interpretation of ``a``. If ``a`` is already an \
  ndarray on the given device with matching dtype, no copy is performed.
  
  Warning:
      If ``device`` argument is omitted, the new array is created on the default
      device, not the device of the input array.
  
  .. seealso:: :func:`numpy.asarray`
  """,
      )
  
      _docs.set_doc(
          chainerx.ascontiguousarray,
          """ascontiguousarray(a, dtype=None, device=None)
  Returns a C-contiguous array.
  
  Args:
      a (~chainerx.ndarray): Source array.
      dtype: Data type.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: C-contiguous array. A copy will be made only if needed.
  
  Warning:
      If ``device`` argument is omitted, the new array is created on the default
      device, not the device of the input array.
  
  .. seealso:: :func:`numpy.ascontiguousarray`
  """,
      )
  
      _docs.set_doc(
          chainerx.copy,
          """copy(a)
  Creates a copy of a given array.
  
  Args:
      a (~chainerx.ndarray): Source array.
  
  Returns:
      ~chainerx.ndarray: A copy array on the same device as ``a``.
  
  Note:
      During backpropagation, this function propagates the gradient of the
      output array to the input array ``a``.
  
  .. seealso:: :func:`numpy.copy`
  """,
      )
  
      _docs.set_doc(
          chainerx.frombuffer,
          """frombuffer(buffer, dtype=float, count=-1, offset=0, device=None)
  Returns a 1-D array interpretation of a buffer.
  
  The given ``buffer`` memory must be usable on the given device, otherwise,
  an error is raised.
  
  Note:
      The ``native`` backend requires a buffer of main memory, and
      the ``cuda`` backend requires a buffer of CUDA memory.
      No copy is performed.
  
  Args:
      buffer: An object that exposes the buffer interface.
      dtype: Data type of the returned array.
      count (int): Number of items to read. -1 means all data in the buffer.
      offset (int): Start reading the buffer from this offset (in bytes).
      device (~chainerx.Device): Device of the returned array.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: 1-D array interpretation of ``buffer``.
  
  .. seealso:: :func:`numpy.frombuffer`
  """,
      )
  
      _docs.set_doc(
          chainerx.arange,
          """arange([start=0, ]stop, [step=1, ]dtype=None, device=None)
  Returns an array with  evenly spaced values within a given interval.
  
  Values are generated within the half-open interval [``start``, ``stop``).
  The first three arguments are mapped like the ``range`` built-in function,
  i.e. ``start`` and ``step`` are optional.
  
  Args:
      start: Start of the interval.
      stop: End of the interval.
      step: Step width between each pair of consecutive values.
      dtype: Data type specifier. It is inferred from other arguments by
          default.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: The 1-D array of range values.
  
  .. seealso:: :func:`numpy.arange`
  """,
      )
  
      _docs.set_doc(
          chainerx.linspace,
          """linspace(start, stop, num=50, endpoint=True, dtype=None, device=None)
  Returns an array with evenly spaced numbers over a specified interval.
  
  Instead of specifying the step width like :func:`chainerx.arange()`,
  this function requires the total number of elements specified.
  
  Args:
      start: Start of the interval.
      stop: End of the interval.
      num: Number of elements.
      endpoint (bool): If ``True``, the stop value is included as the last
          element. Otherwise, the stop value is omitted.
      dtype: Data type specifier. It is inferred from the start and stop
          arguments by default.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: The 1-D array of ranged values.
  
  .. seealso:: :func:`numpy.linspace`
  """,
      )  # NOQA
  
      _docs.set_doc(
          chainerx.diag,
          """diag(v, k=0, device=None)
  Returns a diagonal or a diagonal array.
  
  Args:
      v (~chainerx.ndarray): Array object.
      k (int): Index of diagonals. Zero indicates the main diagonal, a
          positive value an upper diagonal, and a negative value a lower
          diagonal.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: If ``v`` is a 1-D array, then it returns a 2-D
      array with the specified diagonal filled by ``v``. If ``v`` is a
      2-D array, then it returns the specified diagonal of ``v``. In latter
      case, if ``v`` is a :class:`chainerx.ndarray` object, then its view is
      returned.
  
  Note:
      The argument ``v`` does not support array-like objects yet.
  
  .. seealso:: :func:`numpy.diag`
  """,
      )
  
      _docs.set_doc(
          chainerx.diagflat,
          """diagflat(v, k=0, device=None)
  Creates a diagonal array from the flattened input.
  
  Args:
      v (~chainerx.ndarray): Array object.
      k (int): Index of diagonals. See :func:`chainerx.diag`.
      device (~chainerx.Device): Device on which the array is allocated.
          If omitted, :ref:`the default device <chainerx_device>` is chosen.
  
  Returns:
      ~chainerx.ndarray: A 2-D diagonal array with the diagonal copied
      from ``v``.
  
  Note:
      The argument ``v`` does not support array-like objects yet.
  
  .. seealso:: :func:`numpy.diagflat`
  """,
      )
  
      _docs.set_doc(
          chainerx.meshgrid,
          """meshgrid(xi, indexing='xy')
  Returns coordinate matrices from coordinate vectors.
  
  Make N-D coordinate arrays for vectorized evaluations of N-D scalar/vector
  fields over N-D grids, given one-dimensional coordinate arrays x1, x2,…, xn.
  
  Args:
      xi (sequence of :class:`~chainerx.ndarray`\\ s): 1-D arrays
          representing the coordinates of a grid.
      indexing (str): {‘xy’, ‘ij’}, optional
          Cartesian (‘xy’, default) or matrix (‘ij’) indexing of output.
  
  Returns:
      list of :class:`~chainerx.ndarray`\\ s: For vectors x1, x2,…, ‘xn’ with
      lengths Ni=len(xi), return (N1, N2, N3,...Nn) shaped arrays if
      indexing=’ij’ or (N2, N1, N3,...Nn) shaped arrays if indexing=’xy’
      with the elements of xi repeated to fill the matrix along the first
      dimension for x1, the second for x2 and so on.
  
  .. seealso:: :func:`numpy.meshgrid`
  """,
      )
  
file_path: chainer/chainerx/_docs/routines.py
imports: import chainerx
  from chainerx import _docs
label_desc: Use image node_id 2 for calling a global function with example usage: _docs_creation() without return types