code: def one_hot(
      indices: paddle.Tensor,
      depth: int,
      /,
      *,
      on_value: Optional[paddle.Tensor] = None,
      off_value: Optional[paddle.Tensor] = None,
      axis: Optional[int] = None,
      dtype: Optional[paddle.dtype] = None,
      device: core.Place = None,
      out: Optional[paddle.Tensor] = None,
  ) -> paddle.Tensor:
      on_none = on_value is None
      off_none = off_value is None
      expand_ret = False
      if indices.ndim == 0:
          expand_ret = True
          indices = indices.cast("int64").unsqueeze(0)
      if dtype is None:
          if on_none and off_none:
              dtype = paddle.float32
          else:
              if not on_none:
                  dtype = paddle.to_tensor(on_value).dtype
              elif not off_none:
                  dtype = paddle.to_tensor(off_value).dtype
      else:
          dtype = ivy.as_native_dtype(dtype)
  
      on_value = (
          paddle.to_tensor(1.0, dtype="float32")
          if on_none
          else paddle.to_tensor(on_value, dtype="float32")
      )
      off_value = (
          paddle.to_tensor(0.0, dtype="float32")
          if off_none
          else paddle.to_tensor(off_value, dtype="float32")
      )
  
      res = paddle.nn.functional.one_hot(
          indices.cast(paddle.int64), depth
      )
  
      if not on_none or not off_none:
          res = paddle.where(res == 1, on_value, off_value)
  
      if axis is not None:
          res = paddle.moveaxis(res, -1, axis)
      if expand_ret:
          res = res.squeeze()
      return res.cast(dtype)
  
imports: import struct
  from numbers import Number
  from typing import Union, List, Optional, Sequence, Tuple
  import numpy
  import paddle
  import ivy.functional.backends.paddle
  import ivy
  from ivy.func_wrapper import with_unsupported_device_and_dtypes
  from ivy.functional.ivy.creation import _asarray_to_native_arrays_and_back, _asarray_infer_device, _asarray_handle_nestable, _asarray_infer_dtype, NestedSequence, SupportsBufferProtocol, _asarray_inputs_to_native_shapes, _remove_np_bfloat16
  from .None import backend_version
  from paddle.device import core
label_desc: Use image node_id 22 for calling a global function with example usage: one_hot() and returns: res