We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
softshrink


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ivy/functional/frontends/paddle/nn/functional/activation.py`
Content:
```
1 # local
2 import ivy
3 from ivy.func_wrapper import with_supported_dtypes
4 from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
5 from ivy.functional.frontends.paddle.tensor.math import tanh as paddle_tanh
6 from ivy.functional.frontends.paddle.tensor.math import (
7     log_softmax as paddle_log_softmax,
8 )
9 
10 
11 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
12 @to_ivy_arrays_and_back
13 def selu(
14     x,
15     /,
16     *,
17     alpha=1.6732632423543772848170429916717,
18     scale=1.0507009873554804934193349852946,
19     name=None,
20 ):
21     if scale <= 1.0:
22         raise ValueError(f"The scale must be greater than 1.0. Received: {scale}.")
23 
24     if alpha < 0:
25         raise ValueError(f"The alpha must be no less than zero. Received: {alpha}.")
26 
27     ret = ivy.where(x > 0, x, alpha * ivy.expm1(x))
28     arr = scale * ret
29     return ivy.astype(arr, x.dtype)
30 
31 
32 tanh = paddle_tanh
33 log_softmax = paddle_log_softmax
34 
35 
36 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
37 @to_ivy_arrays_and_back
38 def hardshrink(x, threshold=0.5, name=None):
39     mask = ivy.logical_or(ivy.greater(x, threshold), ivy.less(x, -threshold))
40     return ivy.where(mask, x, 0.0)
41 
42 
43 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
44 @to_ivy_arrays_and_back
45 def hardtanh(
46     x,
47     /,
48     *,
49     min=-1.0,
50     max=1.0,
51     name=None,
52 ):
53     less = ivy.where(ivy.less(x, min), min, x)
54     ret = ivy.where(ivy.greater(x, max), max, less).astype(x.dtype)
55     return ret
56 
57 
58 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
59 @to_ivy_arrays_and_back
60 def gelu(x, approximate=False, name=None):
61     return ivy.gelu(x, approximate=approximate)
62 
63 
64 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
65 @to_ivy_arrays_and_back
66 def hardsigmoid(x, slope=0.1666667, offset=0.5, name=None):
67     ret = ivy.minimum(ivy.maximum(ivy.add(ivy.multiply(x, slope), offset), 0), 1)
68     return ret
69 
70 
71 @with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
72 @to_ivy_arrays_and_back
73 def relu6(x, name=None):
74     return ivy.relu6(x)
75
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/ivy/functional/frontends/paddle/nn/functional/activation.py b/ivy/functional/frontends/paddle/nn/functional/activation.py
--- a/ivy/functional/frontends/paddle/nn/functional/activation.py
+++ b/ivy/functional/frontends/paddle/nn/functional/activation.py
@@ -72,3 +72,18 @@
 @to_ivy_arrays_and_back
 def relu6(x, name=None):
     return ivy.relu6(x)
+
+
+@with_supported_dtypes({"2.4.2 and below": ("float32", "float64")}, "paddle")
+@to_ivy_arrays_and_back
+def softshrink(
+    x,
+    /,
+    *,
+    threshold=0.5,
+    name=None,
+):
+    low = ivy.where(ivy.less(x, -threshold), ivy.add(x, threshold), 0)
+    up = ivy.where(ivy.greater(x, threshold), ivy.subtract(x, threshold), 0)
+    add = ivy.add(low, up)
+    return ivy.astype(add, x.dtype)

{"golden_diff": "diff --git a/ivy/functional/frontends/paddle/nn/functional/activation.py b/ivy/functional/frontends/paddle/nn/functional/activation.py\n--- a/ivy/functional/frontends/paddle/nn/functional/activation.py\n+++ b/ivy/functional/frontends/paddle/nn/functional/activation.py\n@@ -72,3 +72,18 @@\n @to_ivy_arrays_and_back\n def relu6(x, name=None):\n     return ivy.relu6(x)\n+\n+\n+@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n+@to_ivy_arrays_and_back\n+def softshrink(\n+    x,\n+    /,\n+    *,\n+    threshold=0.5,\n+    name=None,\n+):\n+    low = ivy.where(ivy.less(x, -threshold), ivy.add(x, threshold), 0)\n+    up = ivy.where(ivy.greater(x, threshold), ivy.subtract(x, threshold), 0)\n+    add = ivy.add(low, up)\n+    return ivy.astype(add, x.dtype)\n", "issue": "softshrink\n\n", "before_files": [{"content": "# local\nimport ivy\nfrom ivy.func_wrapper import with_supported_dtypes\nfrom ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back\nfrom ivy.functional.frontends.paddle.tensor.math import tanh as paddle_tanh\nfrom ivy.functional.frontends.paddle.tensor.math import (\n    log_softmax as paddle_log_softmax,\n)\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef selu(\n    x,\n    /,\n    *,\n    alpha=1.6732632423543772848170429916717,\n    scale=1.0507009873554804934193349852946,\n    name=None,\n):\n    if scale <= 1.0:\n        raise ValueError(f\"The scale must be greater than 1.0. Received: {scale}.\")\n\n    if alpha < 0:\n        raise ValueError(f\"The alpha must be no less than zero. Received: {alpha}.\")\n\n    ret = ivy.where(x > 0, x, alpha * ivy.expm1(x))\n    arr = scale * ret\n    return ivy.astype(arr, x.dtype)\n\n\ntanh = paddle_tanh\nlog_softmax = paddle_log_softmax\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef hardshrink(x, threshold=0.5, name=None):\n    mask = ivy.logical_or(ivy.greater(x, threshold), ivy.less(x, -threshold))\n    return ivy.where(mask, x, 0.0)\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef hardtanh(\n    x,\n    /,\n    *,\n    min=-1.0,\n    max=1.0,\n    name=None,\n):\n    less = ivy.where(ivy.less(x, min), min, x)\n    ret = ivy.where(ivy.greater(x, max), max, less).astype(x.dtype)\n    return ret\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef gelu(x, approximate=False, name=None):\n    return ivy.gelu(x, approximate=approximate)\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef hardsigmoid(x, slope=0.1666667, offset=0.5, name=None):\n    ret = ivy.minimum(ivy.maximum(ivy.add(ivy.multiply(x, slope), offset), 0), 1)\n    return ret\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef relu6(x, name=None):\n    return ivy.relu6(x)\n", "path": "ivy/functional/frontends/paddle/nn/functional/activation.py"}], "after_files": [{"content": "# local\nimport ivy\nfrom ivy.func_wrapper import with_supported_dtypes\nfrom ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back\nfrom ivy.functional.frontends.paddle.tensor.math import tanh as paddle_tanh\nfrom ivy.functional.frontends.paddle.tensor.math import (\n    log_softmax as paddle_log_softmax,\n)\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef selu(\n    x,\n    /,\n    *,\n    alpha=1.6732632423543772848170429916717,\n    scale=1.0507009873554804934193349852946,\n    name=None,\n):\n    if scale <= 1.0:\n        raise ValueError(f\"The scale must be greater than 1.0. Received: {scale}.\")\n\n    if alpha < 0:\n        raise ValueError(f\"The alpha must be no less than zero. Received: {alpha}.\")\n\n    ret = ivy.where(x > 0, x, alpha * ivy.expm1(x))\n    arr = scale * ret\n    return ivy.astype(arr, x.dtype)\n\n\ntanh = paddle_tanh\nlog_softmax = paddle_log_softmax\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef hardshrink(x, threshold=0.5, name=None):\n    mask = ivy.logical_or(ivy.greater(x, threshold), ivy.less(x, -threshold))\n    return ivy.where(mask, x, 0.0)\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef hardtanh(\n    x,\n    /,\n    *,\n    min=-1.0,\n    max=1.0,\n    name=None,\n):\n    less = ivy.where(ivy.less(x, min), min, x)\n    ret = ivy.where(ivy.greater(x, max), max, less).astype(x.dtype)\n    return ret\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef gelu(x, approximate=False, name=None):\n    return ivy.gelu(x, approximate=approximate)\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef hardsigmoid(x, slope=0.1666667, offset=0.5, name=None):\n    ret = ivy.minimum(ivy.maximum(ivy.add(ivy.multiply(x, slope), offset), 0), 1)\n    return ret\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef relu6(x, name=None):\n    return ivy.relu6(x)\n\n\n@with_supported_dtypes({\"2.4.2 and below\": (\"float32\", \"float64\")}, \"paddle\")\n@to_ivy_arrays_and_back\ndef softshrink(\n    x,\n    /,\n    *,\n    threshold=0.5,\n    name=None,\n):\n    low = ivy.where(ivy.less(x, -threshold), ivy.add(x, threshold), 0)\n    up = ivy.where(ivy.greater(x, threshold), ivy.subtract(x, threshold), 0)\n    add = ivy.add(low, up)\n    return ivy.astype(add, x.dtype)\n", "path": "ivy/functional/frontends/paddle/nn/functional/activation.py"}]}