code: def hard_tanh(x):
      n1 = -1
      if "uint" in str(x.dtype):
          dtype = x.dtype
          # tensorflow can't use -1 for uint
          n1 = ivy.asarray(
              (1 << ivy.dtype_bits(dtype)) - 1, dtype=dtype
          )
  
      return ivy.where(x > 1, 1, ivy.where(x < n1, n1, x)).astype(
          x.dtype
      )
  
imports: import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back
  from ivy.func_wrapper import with_supported_dtypes
label_desc: Use image node_id 15 for calling a global function with example usage: hard_tanh(x) and returns: ivy