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


--- 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/torch/random_sampling.py`
Content:
```
1 import ivy
2 from ivy.func_wrapper import with_supported_dtypes
3 from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
4 
5 try:
6     from torch import Generator
7 except ImportError:
8     from types import SimpleNamespace
9 
10     Generator = SimpleNamespace
11 
12 
13 def seed() -> int:
14     """Returns a 64 bit number used to seed the RNG"""
15     return int(ivy.randint(-(2**63), 2**63 - 1))
16 
17 
18 @to_ivy_arrays_and_back
19 def manual_seed(seed: int):
20     ivy.seed(seed_value=seed)
21     return Generator().manual_seed(seed)
22 
23 
24 @with_supported_dtypes(
25     {
26         "1.11.0 and below": (
27             "float32",
28             "float64",
29         )
30     },
31     "torch",
32 )
33 @to_ivy_arrays_and_back
34 def multinomial(input, num_samples, replacement=False, *, generator=None, out=None):
35     return ivy.multinomial(
36         num_samples + 1,  # doesn't matter because `probs` is provided, but should be
37         # greater than the number of samples
38         num_samples,
39         probs=input,
40         replace=replacement,
41         out=out,
42     )
43 
44 
45 @with_supported_dtypes(
46     {
47         "1.11.0 and below": (
48             "float32",
49             "float64",
50         )
51     },
52     "torch",
53 )
54 @to_ivy_arrays_and_back
55 def poisson(input, generator=None):
56     return ivy.poisson(input, shape=None)
57 
58 
59 @to_ivy_arrays_and_back
60 def rand(
61     size,
62     *,
63     generator=None,
64     out=None,
65     dtype=None,
66     layout=None,
67     device=None,
68     requires_grad=False,
69     pin_memory=False
70 ):
71     return ivy.random_uniform(
72         shape=size,
73         out=out,
74         dtype=dtype,
75         device=device,
76     )
77 
78 
79 @to_ivy_arrays_and_back
80 def randn(
81     size,
82     *,
83     generator=None,
84     out=None,
85     dtype=None,
86     layout=None,
87     device=None,
88     requires_grad=False,
89     pin_memory=False
90 ):
91     return ivy.random_normal(
92         shape=size,
93         out=out,
94         dtype=dtype,
95         device=device,
96     )
97
```
--- 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/torch/random_sampling.py b/ivy/functional/frontends/torch/random_sampling.py
--- a/ivy/functional/frontends/torch/random_sampling.py
+++ b/ivy/functional/frontends/torch/random_sampling.py
@@ -76,6 +76,27 @@
     )
 
 
+@to_ivy_arrays_and_back
+def rand_like(
+    input,
+    *,
+    dtype=None,
+    layout=None,
+    device=None,
+    requires_grad=False,
+    memory_format=False
+):
+    shape = input.shape
+    if not dtype:
+        dtype = input.dtype
+
+    return ivy.random_uniform(
+        shape=shape,
+        dtype=dtype,
+        device=device,
+    )
+
+
 @to_ivy_arrays_and_back
 def randn(
     size,

{"golden_diff": "diff --git a/ivy/functional/frontends/torch/random_sampling.py b/ivy/functional/frontends/torch/random_sampling.py\n--- a/ivy/functional/frontends/torch/random_sampling.py\n+++ b/ivy/functional/frontends/torch/random_sampling.py\n@@ -76,6 +76,27 @@\n     )\n \n \n+@to_ivy_arrays_and_back\n+def rand_like(\n+    input,\n+    *,\n+    dtype=None,\n+    layout=None,\n+    device=None,\n+    requires_grad=False,\n+    memory_format=False\n+):\n+    shape = input.shape\n+    if not dtype:\n+        dtype = input.dtype\n+\n+    return ivy.random_uniform(\n+        shape=shape,\n+        dtype=dtype,\n+        device=device,\n+    )\n+\n+\n @to_ivy_arrays_and_back\n def randn(\n     size,\n", "issue": "rand_like\n\n", "before_files": [{"content": "import ivy\nfrom ivy.func_wrapper import with_supported_dtypes\nfrom ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back\n\ntry:\n    from torch import Generator\nexcept ImportError:\n    from types import SimpleNamespace\n\n    Generator = SimpleNamespace\n\n\ndef seed() -> int:\n    \"\"\"Returns a 64 bit number used to seed the RNG\"\"\"\n    return int(ivy.randint(-(2**63), 2**63 - 1))\n\n\n@to_ivy_arrays_and_back\ndef manual_seed(seed: int):\n    ivy.seed(seed_value=seed)\n    return Generator().manual_seed(seed)\n\n\n@with_supported_dtypes(\n    {\n        \"1.11.0 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef multinomial(input, num_samples, replacement=False, *, generator=None, out=None):\n    return ivy.multinomial(\n        num_samples + 1,  # doesn't matter because `probs` is provided, but should be\n        # greater than the number of samples\n        num_samples,\n        probs=input,\n        replace=replacement,\n        out=out,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"1.11.0 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef poisson(input, generator=None):\n    return ivy.poisson(input, shape=None)\n\n\n@to_ivy_arrays_and_back\ndef rand(\n    size,\n    *,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False\n):\n    return ivy.random_uniform(\n        shape=size,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@to_ivy_arrays_and_back\ndef randn(\n    size,\n    *,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False\n):\n    return ivy.random_normal(\n        shape=size,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n", "path": "ivy/functional/frontends/torch/random_sampling.py"}], "after_files": [{"content": "import ivy\nfrom ivy.func_wrapper import with_supported_dtypes\nfrom ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back\n\ntry:\n    from torch import Generator\nexcept ImportError:\n    from types import SimpleNamespace\n\n    Generator = SimpleNamespace\n\n\ndef seed() -> int:\n    \"\"\"Returns a 64 bit number used to seed the RNG\"\"\"\n    return int(ivy.randint(-(2**63), 2**63 - 1))\n\n\n@to_ivy_arrays_and_back\ndef manual_seed(seed: int):\n    ivy.seed(seed_value=seed)\n    return Generator().manual_seed(seed)\n\n\n@with_supported_dtypes(\n    {\n        \"1.11.0 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef multinomial(input, num_samples, replacement=False, *, generator=None, out=None):\n    return ivy.multinomial(\n        num_samples + 1,  # doesn't matter because `probs` is provided, but should be\n        # greater than the number of samples\n        num_samples,\n        probs=input,\n        replace=replacement,\n        out=out,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"1.11.0 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef poisson(input, generator=None):\n    return ivy.poisson(input, shape=None)\n\n\n@to_ivy_arrays_and_back\ndef rand(\n    size,\n    *,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False\n):\n    return ivy.random_uniform(\n        shape=size,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@to_ivy_arrays_and_back\ndef rand_like(\n    input,\n    *,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    memory_format=False\n):\n    shape = input.shape\n    if not dtype:\n        dtype = input.dtype\n\n    return ivy.random_uniform(\n        shape=shape,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@to_ivy_arrays_and_back\ndef randn(\n    size,\n    *,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False\n):\n    return ivy.random_normal(\n        shape=size,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n", "path": "ivy/functional/frontends/torch/random_sampling.py"}]}