code: def linspace(
      start: Union[ivy.Array, ivy.NativeArray, float],
      stop: Union[ivy.Array, ivy.NativeArray, float],
      /,
      num: int,
      *,
      axis: Optional[int] = None,
      endpoint: bool = True,
      dtype: Optional[Union[ivy.Dtype, ivy.NativeDtype]] = None,
      device: Optional[Union[ivy.Device, ivy.NativeDevice]] = None,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Generate a certain number of evenly-spaced values in an interval along a
      given axis.
  
      See :math:`arange` that allows to specify the step size of evenly spaced values in
      an interval.
  
      Parameters
      ----------
      start
          First entry in the range.
      stop
          Final entry in the range.
      num
          Number of values to generate.
      axis
          Axis along which the operation is performed.
      endpoint
          If True, stop is the last sample. Otherwise, it is not included.
      dtype
          output array data type.
      device
          device on which to create the array 'cuda:0', 'cuda:1', 'cpu' etc.
      out
          optional output array, for writing the result to. It must have a shape that the
          inputs broadcast to.
  
      Returns
      -------
      ret
          Tensor of evenly-spaced values.
  
  
      This function conforms to the `Array API Standard
      <https://data-apis.org/array-api/latest/>`_. This docstring is an extension of the
      `docstring <https://data-apis.org/array-api/latest/
      API_specification/generated/array_api.linspace.html>`_
      in the standard.
  
      Both the description and the type hints above assumes an array input for simplicity,
      but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
      instances in place of any of the arguments.
  
      Examples
      --------
      With float input:
  
      >>> x = ivy.linspace(1, 2, 3)
      >>> print(x)
      ivy.array([1. , 1.5, 2. ])
  
      >>> x = ivy.linspace(1, 2, 4, endpoint=False)
      >>> print(x)
      ivy.array([1., 1.25, 1.5 , 1.75])
  
      >>> x = ivy.linspace(1, 10, 4, dtype="int32")
      >>> print(x)
      ivy.array([ 1,  4,  7, 10])
  
      >>> x = ivy.linspace(1, 2, 4, device= "cpu")
      >>> print(x)
      ivy.array([1., 1.33333337, 1.66666663, 2.])
  
      >>> y = ivy.array([0,0,0,0])
      >>> ivy.linspace(1, 2, 4, out= y)
      >>> print(y)
      ivy.array([1, 1, 1, 2])
  
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([1,2])
      >>> y = ivy.array([4,5])
      >>> z = ivy.linspace(x, y, 4, axis = 0)
      >>> print(z)
      ivy.array([[1, 2],
                 [2, 3],
                 [3, 4],
                 [4, 5]])
      """
      return current_backend(start).linspace(
          start,
          stop,
          num,
          axis=axis,
          endpoint=endpoint,
          dtype=dtype,
          device=device,
          out=out,
      )
  
imports: from __future__ import annotations
  import functools
  from numbers import Number
  from typing import Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable
  import numpy
  import ivy
  from ivy import to_ivy
  from ivy.utils.exceptions import handle_exceptions
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, infer_dtype, handle_out_argument, outputs_to_ivy_arrays, inputs_to_native_arrays, inputs_to_native_shapes, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid, temp_asarray_wrapper
label_desc: Use image node_id 22 for calling a global function with example usage: linspace(num) and returns: current_backend