docstr: Apply the hard shrinkage function element-wise.
  
  Parameters
  ----------
  self
      Input container.
  lambd
      Lambda value for hard shrinkage calculation.
  key_chains
      The key-chains to apply or not apply the method to.
  to_apply
      If True, the method will be applied to key_chains, otherwise key_chains
      will be skipped.
  prune_unapplied
      Whether to prune key_chains for which the function was not applied.
  map_sequences
      Whether to also map method to sequences (lists, tuples).
  out
      optional output container, for writing the result to. It must have a shape
      that the inputs broadcast to.
  
  Returns
  -------
  ret
      Container with hard shrinkage applied to the leaves.
  
  Examples
  --------
  >>> import ivy.numpy as np
  >>> x = ivy.Container(a=np.array([1., -2.]), b=np.array([0.4, -0.2]))
  >>> y = ivy.Container.hardshrink(x)
  >>> print(y)
  {
      a: ivy.array([1., -2.]),
      b: ivy.array([0., 0.])
  }
docstr_tok: ["Apply","the","hard","shrinkage","function","element-wise",".","Parameters","--","--","--","--","--","self","Input","container",".","lambd","Lambda","value","for","hard","shrinkage","calculation",".","key_chains","The","key-chains","to","apply","or","not","apply","the","method","to",".","to_apply","If","True",",","the","method","will","be","applied","to","key_chains",",","otherwise","key_chains","will","be","skipped",".","prune_unapplied","Whether","to","prune","key_chains","for","which","the","function","was","not","applied",".","map_sequences","Whether","to","also","map","method","to","sequences","(","lists",",","tuples",")",".","out","optional","output","container",",","for","writing","the","result","to",".","It","must","have","a","shape","that","the","inputs","broadcast","to",".","Returns","--","--","--","-","ret","Container","with","hard","shrinkage","applied","to","the","leaves",".","Examples","--","--","--","--",">",">",">","import","ivy.numpy","as","np",">",">",">","x","=","ivy.Container","(","a=np.array","(","[","1.",",","-2",".","]",")",",","b=np.array","(","[","0.4",",","-0.2","]",")",")",">",">",">","y","=","ivy.Container.hardshrink","(","x",")",">",">",">","print","(","y",")","{","a",":","ivy.array","(","[","1.",",","-2",".","]",")",",","b",":","ivy.array","(","[","0.",",","0",".","]",")","}"]
code: def hardshrink(
      self: ivy.Container,
      /,
      *,
      lambd: ivy.Container = 0.5,
      key_chains: Optional[
          Union[List[str], Dict[str, str], ivy.Container]
      ] = None,
      to_apply: Union[bool, ivy.Container] = False,
      prune_unapplied: Union[bool, ivy.Container] = True,
      map_sequences: Union[bool, ivy.Container] = False,
      out: Optional[ivy.Container] = None,
  ) -> ivy.Container:
      """Apply the hard shrinkage function element-wise.
  
      Parameters
      ----------
      self
          Input container.
      lambd
          Lambda value for hard shrinkage calculation.
      key_chains
          The key-chains to apply or not apply the method to.
      to_apply
          If True, the method will be applied to key_chains, otherwise key_chains
          will be skipped.
      prune_unapplied
          Whether to prune key_chains for which the function was not applied.
      map_sequences
          Whether to also map method to sequences (lists, tuples).
      out
          optional output container, for writing the result to. It must have a shape
          that the inputs broadcast to.
  
      Returns
      -------
      ret
          Container with hard shrinkage applied to the leaves.
  
      Examples
      --------
      >>> import ivy.numpy as np
      >>> x = ivy.Container(a=np.array([1., -2.]), b=np.array([0.4, -0.2]))
      >>> y = ivy.Container.hardshrink(x)
      >>> print(y)
      {
          a: ivy.array([1., -2.]),
          b: ivy.array([0., 0.])
      }
      """
      return self._static_hardshrink(
          self,
          lambd=lambd,
          key_chains=key_chains,
          to_apply=to_apply,
          prune_unapplied=prune_unapplied,
          map_sequences=map_sequences,
          out=out,
      )
  
imports: from typing import Union, Optional, List, Dict, Literal
  import ivy
  from ivy.data_classes.container.base import ContainerBase
label_desc: Use image node_id 30 for calling the _ContainerWithActivationExperimental obj's underlying member method code with example usage: obj.hardshrink() and returns: self