docstr: ivy.Container instance method variant of ivy.one_hot. This method
  simply wraps the function, and so the docstring for ivy.one_hot also
  applies to this method with minimal changes.
  
  Parameters
  ----------
  self
      Indices for where the ones should be scattered *[batch_shape, dim]*
  depth
      Scalar defining the depth of the one-hot dimension.
  on_value
      Value to fill in output when indices[j] == i. If None, defaults to 1.
  off_value
      Value to fill in output when indices[j] != i. If None, defaults to 0.
  axis
      Axis to scatter on. The default is ``-1``, a new inner-most axis is created.
  dtype
      The dtype of the returned tensor. If None, defaults to the on_value dtype
      or the off_value dtype. If both are None, defaults to float32.
  key_chains
      The key-chains to apply or not apply the method to. Default is ``None``.
  to_apply
      If True, the method will be applied to key_chains, otherwise key_chains will
      be skipped. Default is ``True``.
  prune_unapplied
      Whether to prune key_chains for which the function was not applied. Default
      is False.
  map_sequences
      Whether to also map method to sequences (lists, tuples).
      Default is ``False``.
  out
      optional output container, for writing the result to. It must have a
      shape that the inputs broadcast to.
  
  Returns
  -------
  ret
      container with tensors of zeros with the same shape and type as the inputs,
      unless dtype provided which overrides.
  
  Examples
  --------
  With :class:`ivy.Container` input:
  
  >>> x = ivy.Container(a=ivy.array([1, 2]),              b=ivy.array([3, 1]), c=ivy.array([2, 3]))
  >>> y = 5
  >>> z = x.one_hot(y)
  >>> print(z)
  {
      a: ivy.array([[0., 1., 0., 0., 0.],
                  [0., 0., 1., 0., 0.]]),
      b: ivy.array([[0., 0., 0., 1., 0.],
                  [0., 1., 0., 0., 0.]]),
      c: ivy.array([[0., 0., 1., 0., 0.],
                  [0., 0., 0., 1., 0.]])
  }
  
  >>> x = ivy.Container(a=ivy.array([1, 2]),              b=ivy.array([]), c=ivy.native_array([4]))
  >>> y = 5
  >>> z = x.one_hot(y)
  >>> print(z)
  {
      a: ivy.array([[0., 1., 0., 0., 0.],
                  [0., 0., 1., 0., 0.]]),
      b: ivy.array([], shape=(0, 5)),
      c: ivy.array([[0., 0., 0., 0., 1.]])
  }
docstr_tok: ["ivy.Container","instance","method","variant","of","ivy.one_hot",".","This","method","simply","wraps","the","function",",","and","so","the","docstring","for","ivy.one_hot","also","applies","to","this","method","with","minimal","changes",".","Parameters","--","--","--","--","--","self","Indices","for","where","the","ones","should","be","scattered","*","[","batch_shape",",","dim","]","*","depth","Scalar","defining","the","depth","of","the","one-hot","dimension",".","on_value","Value","to","fill","in","output","when","indices","[","j","]","==","i",".","If","None",",","defaults","to","1.","off_value","Value","to","fill","in","output","when","indices","[","j","]","!","=","i",".","If","None",",","defaults","to","0.","axis","Axis","to","scatter","on",".","The","default","is","``","-1","``",",","a","new","inner-most","axis","is","created",".","dtype","The","dtype","of","the","returned","tensor",".","If","None",",","defaults","to","the","on_value","dtype","or","the","off_value","dtype",".","If","both","are","None",",","defaults","to","float32",".","key_chains","The","key-chains","to","apply","or","not","apply","the","method","to",".","Default","is","``","None","``",".","to_apply","If","True",",","the","method","will","be","applied","to","key_chains",",","otherwise","key_chains","will","be","skipped",".","Default","is","``","True","``",".","prune_unapplied","Whether","to","prune","key_chains","for","which","the","function","was","not","applied",".","Default","is","False",".","map_sequences","Whether","to","also","map","method","to","sequences","(","lists",",","tuples",")",".","Default","is","``","False","``",".","out","optional","output","container",",","for","writing","the","result","to",".","It","must","have","a","shape","that","the","inputs","broadcast","to",".","Returns","--","--","--","-","ret","container","with","tensors","of","zeros","with","the","same","shape","and","type","as","the","inputs",",","unless","dtype","provided","which","overrides",".","Examples","--","--","--","--","With",":","class",":","`","ivy.Container","`","input",":",">",">",">","x","=","ivy.Container","(","a=ivy.array","(","[","1",",","2","]",")",",","b=ivy.array","(","[","3",",","1","]",")",",","c=ivy.array","(","[","2",",","3","]",")",")",">",">",">","y","=","5",">",">",">","z","=","x.one_hot","(","y",")",">",">",">","print","(","z",")","{","a",":","ivy.array","(","[","[","0.",",","1.",",","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","1.",",","0.",",","0",".","]","]",")",",","b",":","ivy.array","(","[","[","0.",",","0.",",","0.",",","1.",",","0",".","]",",","[","0.",",","1.",",","0.",",","0.",",","0",".","]","]",")",",","c",":","ivy.array","(","[","[","0.",",","0.",",","1.",",","0.",",","0",".","]",",","[","0.",",","0.",",","0.",",","1.",",","0",".","]","]",")","}",">",">",">","x","=","ivy.Container","(","a=ivy.array","(","[","1",",","2","]",")",",","b=ivy.array","(","[","]",")",",","c=ivy.native_array","(","[","4","]",")",")",">",">",">","y","=","5",">",">",">","z","=","x.one_hot","(","y",")",">",">",">","print","(","z",")","{","a",":","ivy.array","(","[","[","0.",",","1.",",","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","1.",",","0.",",","0",".","]","]",")",",","b",":","ivy.array","(","[","]",",","shape=","(","0",",","5",")",")",",","c",":","ivy.array","(","[","[","0.",",","0.",",","0.",",","0.",",","1",".","]","]",")","}"]
code: def one_hot(
      self: ivy.Container,
      depth: Union[int, ivy.Container],
      /,
      key_chains: Optional[
          Union[List[str], Dict[str, str], ivy.Container]
      ] = None,
      to_apply: Union[bool, ivy.Container] = True,
      prune_unapplied: Union[bool, ivy.Container] = False,
      map_sequences: Union[bool, ivy.Container] = False,
      *,
      on_value: Optional[Union[Number, ivy.Container]] = None,
      off_value: Optional[Union[Number, ivy.Container]] = None,
      axis: Optional[Union[int, ivy.Container]] = None,
      dtype: Optional[
          Union[ivy.Dtype, ivy.NativeDtype, ivy.Container]
      ] = None,
      device: Optional[
          Union[ivy.Device, ivy.NativeDevice, ivy.Container]
      ] = None,
      out: Optional[ivy.Container] = None,
  ) -> ivy.Container:
      """ivy.Container instance method variant of ivy.one_hot. This method
          simply wraps the function, and so the docstring for ivy.one_hot also
          applies to this method with minimal changes.
  
          Parameters
          ----------
          self
              Indices for where the ones should be scattered *[batch_shape, dim]*
          depth
              Scalar defining the depth of the one-hot dimension.
          on_value
              Value to fill in output when indices[j] == i. If None, defaults to 1.
          off_value
              Value to fill in output when indices[j] != i. If None, defaults to 0.
          axis
              Axis to scatter on. The default is ``-1``, a new inner-most axis is created.
          dtype
              The dtype of the returned tensor. If None, defaults to the on_value dtype
              or the off_value dtype. If both are None, defaults to float32.
          key_chains
              The key-chains to apply or not apply the method to. Default is ``None``.
          to_apply
              If True, the method will be applied to key_chains, otherwise key_chains will
              be skipped. Default is ``True``.
          prune_unapplied
              Whether to prune key_chains for which the function was not applied. Default
              is False.
          map_sequences
              Whether to also map method to sequences (lists, tuples).
              Default is ``False``.
          out
              optional output container, for writing the result to. It must have a
              shape that the inputs broadcast to.
  
          Returns
          -------
          ret
              container with tensors of zeros with the same shape and type as the inputs,
              unless dtype provided which overrides.
  
          Examples
          --------
          With :class:`ivy.Container` input:
  
          >>> x = ivy.Container(a=ivy.array([1, 2]), \
               b=ivy.array([3, 1]), c=ivy.array([2, 3]))
          >>> y = 5
          >>> z = x.one_hot(y)
          >>> print(z)
          {
              a: ivy.array([[0., 1., 0., 0., 0.],
                          [0., 0., 1., 0., 0.]]),
              b: ivy.array([[0., 0., 0., 1., 0.],
                          [0., 1., 0., 0., 0.]]),
              c: ivy.array([[0., 0., 1., 0., 0.],
                          [0., 0., 0., 1., 0.]])
          }
  
          >>> x = ivy.Container(a=ivy.array([1, 2]), \
               b=ivy.array([]), c=ivy.native_array([4]))
          >>> y = 5
          >>> z = x.one_hot(y)
          >>> print(z)
          {
              a: ivy.array([[0., 1., 0., 0., 0.],
                          [0., 0., 1., 0., 0.]]),
              b: ivy.array([], shape=(0, 5)),
              c: ivy.array([[0., 0., 0., 0., 1.]])
          }
          """
      return self._static_one_hot(
          self,
          depth,
          key_chains=key_chains,
          to_apply=to_apply,
          prune_unapplied=prune_unapplied,
          map_sequences=map_sequences,
          on_value=on_value,
          off_value=off_value,
          axis=axis,
          dtype=dtype,
          device=device,
          out=out,
      )
  
imports: from typing import Optional, Union, List, Tuple, Dict, Sequence
  from numbers import Number
  import numpy
  import ivy
  from ivy.data_classes.container.base import ContainerBase
label_desc: Use image node_id 34 for calling the _ContainerWithCreation obj's underlying member method code with example usage: obj.one_hot(key_chains, to_apply, prune_unapplied, map_sequences) and returns: self