code: def hardtanh(input, min_val=-1.0, max_val=1.0, inplace=False):
      less = ivy.where(ivy.less(input, min_val), min_val, input)
      return ivy.where(
          ivy.greater(input, max_val), max_val, less
      ).astype(input.dtype)
  
imports: import ivy
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 11 for calling a global function with example usage: hardtanh(input, min_val, max_val, inplace) and returns: ivy