code: def unique_all(
      x: paddle.Tensor,
      /,
      *,
      axis: Optional[int] = None,
      by_value: bool = True,
  ) -> Tuple[
      paddle.Tensor, paddle.Tensor, paddle.Tensor, paddle.Tensor
  ]:
      Results = namedtuple(
          "Results",
          ["values", "indices", "inverse_indices", "counts"],
      )
  
      x_dtype = x.dtype
      if axis is not None:
          axis = axis % x.ndim
      values, inverse_indices, counts = paddle.unique(
          x,
          return_index=False,  # which occurrences of the unique values are picked is
          # inconsistent in some cases, so calculate the indices manually below
          return_counts=True,
          return_inverse=True,
          axis=axis,
      )
  
      unique_nan = paddle.isnan(values)
      idx_dtype = inverse_indices.dtype
      if paddle.any(unique_nan):
          nan_index = paddle.where(paddle.isnan(x))
          non_nan_index = [
              x.tolist().index(val)
              for val in values
              if not paddle.isnan(val)
          ]
          indices = values.clone().to(idx_dtype)
          indices[unique_nan] = nan_index[0]
          inverse_indices[paddle.isnan(x)] = paddle.where(unique_nan)[
              0
          ][0]
          counts[unique_nan] = 1
          indices[~unique_nan] = paddle.to_tensor(
              non_nan_index, dtype=idx_dtype
          )
      else:
          decimals = (
              paddle.arange(inverse_indices.numel())
              / inverse_indices.numel()
          )
          inv_sorted = (
              inverse_indices.astype(decimals.dtype) + decimals
          ).argsort()
          tot_counts = paddle.concat(
              (
                  paddle.zeros((1,), dtype=counts.dtype),
                  counts.cumsum(axis=0),
              )
          )[:-1]
          indices = inv_sorted[tot_counts].astype(idx_dtype)
  
      if not by_value:
          sort_idx = paddle.argsort(indices)
      else:
          if axis is None:
              axis = 0
          values_ = paddle.moveaxis(values, axis, 0)
          values_ = paddle.reshape(values_, (values_.shape[0], -1))
          sort_idx = paddle.to_tensor(
              [
                  i[0]
                  for i in sorted(
                      enumerate(values_.numpy().tolist()),
                      key=lambda x: tuple(x[1]),
                  )
              ]
          )
      values = paddle.gather(values, sort_idx, axis=axis)
      counts = paddle.gather(counts, sort_idx)
      indices = paddle.gather(indices, sort_idx)
      inv_sort_idx = paddle_backend.invert_permutation(sort_idx)
      inverse_indices = paddle_backend.vmap(
          lambda y: paddle.gather(inv_sort_idx, y)
      )(inverse_indices)
  
      return Results(
          values.cast(x_dtype),
          indices,
          inverse_indices,
          counts,
      )
  
file_path: ivy/ivy/functional/backends/paddle/set.py
imports: import paddle
  from typing import Tuple, Optional
  from collections import namedtuple
  import ivy.functional.backends.paddle
  from ivy.func_wrapper import with_supported_dtypes
  from .None import backend_version
label_desc: Use image node_id 1 for calling a global function with example usage: unique_all() and returns: Results