code: def linspace(
      start: Union[tf.Tensor, tf.Variable, float],
      stop: Union[tf.Tensor, tf.Variable, float],
      /,
      num: int,
      *,
      axis: Optional[int] = None,
      endpoint: bool = True,
      dtype: tf.DType,
      device: Optional[str] = None,
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ):
      if axis is None:
          axis = -1
      start = tf.cast(tf.constant(start), dtype=dtype)
      stop = tf.cast(tf.constant(stop), dtype=dtype)
      if not endpoint:
          ans = tf.linspace(start, stop, num + 1, axis=axis)
          if axis < 0:
              axis += len(ans.shape)
          ans = tf.convert_to_tensor(
              ans.numpy()[_slice_at_axis(slice(None, -1), axis)]
          )
      else:
          ans = tf.linspace(start, stop, num, axis=axis)
      if dtype.is_integer and ans.dtype.is_floating:
          ans = tf.math.floor(ans)
      return tf.cast(ans, dtype)
  
imports: import numpy
  from numbers import Number
  from typing import Union, List, Optional, Sequence, Tuple
  import tensorflow
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.ivy.creation import _asarray_to_native_arrays_and_back, _asarray_infer_device, _asarray_infer_dtype, _asarray_handle_nestable, NestedSequence, SupportsBufferProtocol, _asarray_inputs_to_native_shapes
  from .None import backend_version
label_desc: Use image node_id 11 for calling a global function with example usage: linspace(num) and returns: tf