code: def hardtanh(
      x,
      /,
      *,
      min=-1.0,
      max=1.0,
      name=None,
  ):
      less = ivy.where(ivy.less(x, min), min, x)
      ret = ivy.where(ivy.greater(x, max), max, less).astype(x.dtype)
      return ret
  
imports: import ivy
  from ivy.func_wrapper import with_supported_dtypes
  from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
  from ivy.functional.frontends.paddle.tensor.math import tanh
label_desc: Use image node_id 9 for calling a global function with example usage: hardtanh() and returns: ret