code: def rfft(
      x: paddle.Tensor,
      /,
      *,
      n: Optional[int] = None,
      axis: int = -1,
      norm: Literal["backward", "ortho", "forward"] = "backward",
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      if x.dtype in [paddle.complex64, paddle.complex128]:
          x = x.real()
      if x.dtype == paddle.float16:
          x = x.astype(paddle.float32)
  
      ret = paddle.fft.rfft(x, n=n, axis=axis, norm=norm)
  
      if ivy.exists(out):
          return ivy.inplace_update(out, ret)
      return ret
  
imports: from typing import Optional, Union, Tuple, List, Literal, Sequence, Callable
  import paddle
  from ivy.functional.ivy.layers import _handle_padding, _depth_max_pooling_helper, _validate_max_pool_params
  from ivy.utils.exceptions import IvyNotImplementedException, IvyValueError
  from ivy.func_wrapper import with_supported_device_and_dtypes, with_unsupported_dtypes, with_supported_dtypes
  from ..None import backend_version
  import ivy
label_desc: Use image node_id 18 for calling a global function with example usage: rfft() and returns: ret, ivy