code: def unique_inverse(
      x: paddle.Tensor,
      /,
      *,
      axis: Optional[int] = None,
  ) -> Tuple[paddle.Tensor, paddle.Tensor]:
      if x.dtype not in [
          paddle.int32,
          paddle.int64,
          paddle.float32,
          paddle.float64,
      ]:
          x = x.cast("float32")
  
      if axis is not None:
          unique, inverse_val = paddle.unique(
              x, return_inverse=True, axis=axis
          )
  
      if axis is None:
          axis = 0
  
      nan_idx = paddle.where(paddle.isnan(x) > 0)
      nan_count = paddle.count_nonzero(nan_idx).numpy()[0]
  
      if nan_count > 0:
          inverse_val[nan_idx] = len(unique)
          unique_nan = paddle.full(
              shape=[1, nan_count], fill_value=float("nan")
          ).cast(x.dtype)
          unique = paddle.concat(
              [
                  unique.astype(x.dtype),
                  paddle.reshape(unique_nan, [nan_count]),
              ],
              axis=-1,
          )
      inverse_val = paddle.reshape(inverse_val, shape=x.shape)
      Results = namedtuple("Results", ["values", "inverse_indices"])
      return Results(unique.cast(x.dtype), inverse_val)
  
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 3 for calling a global function with example usage: unique_inverse() and returns: Results