We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
randint_like
Add randint_like function to pytorch frontend

--- 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 
6 # ToDo: will need to create a Generator class to be able to fully test these functions
7 
8 
9 def seed() -> int:
10     """Return a 64 bit number used to seed the RNG."""
11     return int(ivy.randint(-(2**63), 2**63 - 1))
12 
13 
14 @to_ivy_arrays_and_back
15 def manual_seed(seed: int):
16     ivy.seed(seed_value=seed)
17     return None
18 
19 
20 @with_supported_dtypes(
21     {
22         "2.0.1 and below": (
23             "float32",
24             "float64",
25         )
26     },
27     "torch",
28 )
29 @to_ivy_arrays_and_back
30 def multinomial(input, num_samples, replacement=False, *, generator=None, out=None):
31     seed = generator.initial_seed() if generator is not None else None
32     return ivy.multinomial(
33         num_samples + 1,  # doesn't matter because `probs` is provided, but should be
34         # greater than the number of samples
35         num_samples,
36         probs=input,
37         replace=replacement,
38         seed=seed,
39         out=out,
40     )
41 
42 
43 @with_supported_dtypes(
44     {
45         "2.0.1 and below": (
46             "float32",
47             "float64",
48         )
49     },
50     "torch",
51 )
52 @to_ivy_arrays_and_back
53 def poisson(input, generator=None):
54     seed = generator.initial_seed() if generator is not None else None
55     return ivy.poisson(input, seed=seed, shape=None)
56 
57 
58 @to_ivy_arrays_and_back
59 def randint(
60     low,
61     high,
62     size,
63     *,
64     generator=None,
65     out=None,
66     dtype=None,
67     layout=None,
68     device=None,
69     requires_grad=False,
70 ):
71     seed = generator.initial_seed() if generator is not None else None
72     return ivy.randint(
73         low,
74         high,
75         shape=size,
76         seed=seed,
77         out=out,
78         dtype=dtype,
79         device=device,
80     )
81 
82 
83 @to_ivy_arrays_and_back
84 def rand(
85     *size,
86     generator=None,
87     out=None,
88     dtype=None,
89     layout=None,
90     device=None,
91     requires_grad=False,
92     pin_memory=False,
93     **kwargs,
94 ):
95     if not size and "size" not in kwargs:
96         raise ValueError("Missing 1 required positional/keyword argument: size")
97     size = kwargs["size"] if not size else size
98     if (
99         isinstance(size, (list, tuple))
100         and len(size) == 1
101         and isinstance(size[0], (list, tuple))
102     ):
103         size = size[0]
104     seed = generator.initial_seed() if generator is not None else None
105     return ivy.random_uniform(
106         shape=size,
107         seed=seed,
108         out=out,
109         dtype=dtype,
110         device=device,
111     )
112 
113 
114 @with_supported_dtypes(
115     {
116         "2.0.1 and below": (
117             "float32",
118             "float64",
119         )
120     },
121     "torch",
122 )
123 @to_ivy_arrays_and_back
124 def normal(mean, std, *, generator=None, out=None):
125     seed = generator.initial_seed() if generator is not None else None
126     return ivy.random_normal(mean=mean, std=std, seed=seed, out=out)
127 
128 
129 @to_ivy_arrays_and_back
130 def rand_like(
131     input,
132     *,
133     dtype=None,
134     layout=None,
135     device=None,
136     requires_grad=False,
137     memory_format=False,
138 ):
139     shape = input.shape
140     if not dtype:
141         dtype = input.dtype
142 
143     return ivy.random_uniform(
144         shape=shape,
145         dtype=dtype,
146         device=device,
147     )
148 
149 
150 @to_ivy_arrays_and_back
151 def randn(
152     *size,
153     generator=None,
154     out=None,
155     dtype=None,
156     layout=None,
157     device=None,
158     requires_grad=False,
159     pin_memory=False,
160     **kwargs,
161 ):
162     if not size and "size" not in kwargs:
163         raise ValueError("Missing 1 required positional/keyword argument: size")
164     size = kwargs["size"] if not size else size
165     if (
166         isinstance(size, (list, tuple))
167         and len(size) == 1
168         and isinstance(size[0], (list, tuple))
169     ):
170         size = size[0]
171     seed = generator.initial_seed() if generator is not None else None
172     return ivy.random_normal(
173         shape=size,
174         seed=seed,
175         out=out,
176         dtype=dtype,
177         device=device,
178     )
179 
180 
181 @to_ivy_arrays_and_back
182 def randn_like(
183     input,
184     *,
185     dtype=None,
186     layout=None,
187     device=None,
188     requires_grad=False,
189     memory_format=None,
190 ):
191     shape = input.shape
192     if not dtype:
193         dtype = input.dtype
194 
195     return ivy.random_normal(
196         shape=shape,
197         dtype=dtype,
198         device=device,
199     )
200 
201 
202 @with_supported_dtypes(
203     {
204         "2.0.1 and below": (
205             "float32",
206             "float64",
207         )
208     },
209     "torch",
210 )
211 @to_ivy_arrays_and_back
212 def bernoulli(input, *, generator=None, out=None):
213     seed = generator.initial_seed() if generator is not None else None
214     return ivy.bernoulli(input, seed=seed, out=out)
215 
216 
217 @to_ivy_arrays_and_back
218 def randperm(
219     n,
220     *,
221     generator=None,
222     out=None,
223     dtype=ivy.int64,
224     layout=None,
225     device=None,
226     requires_grad=False,
227     pin_memory=False,
228 ):
229     seed = generator.initial_seed() if generator is not None else None
230     arr = ivy.arange(n, device=device, dtype=dtype)
231     ret = ivy.shuffle(arr, seed=seed, out=out)
232     return ret
233
```
--- 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
@@ -230,3 +230,26 @@
     arr = ivy.arange(n, device=device, dtype=dtype)
     ret = ivy.shuffle(arr, seed=seed, out=out)
     return ret
+
+
+@to_ivy_arrays_and_back
+def randint_like(
+    input,
+    low,
+    high,
+    *,
+    dtype=None,
+    layout=None,
+    device=None,
+    requires_grad=False,
+    memory_format=None,
+):
+    shape = input.shape
+
+    return ivy.randint(
+        low,
+        high,
+        shape=shape,
+        device=device,
+        dtype=dtype,
+    )

{"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@@ -230,3 +230,26 @@\n     arr = ivy.arange(n, device=device, dtype=dtype)\n     ret = ivy.shuffle(arr, seed=seed, out=out)\n     return ret\n+\n+\n+@to_ivy_arrays_and_back\n+def randint_like(\n+    input,\n+    low,\n+    high,\n+    *,\n+    dtype=None,\n+    layout=None,\n+    device=None,\n+    requires_grad=False,\n+    memory_format=None,\n+):\n+    shape = input.shape\n+\n+    return ivy.randint(\n+        low,\n+        high,\n+        shape=shape,\n+        device=device,\n+        dtype=dtype,\n+    )\n", "issue": "randint_like\nAdd randint_like function to pytorch frontend\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\n\n# ToDo: will need to create a Generator class to be able to fully test these functions\n\n\ndef seed() -> int:\n    \"\"\"Return 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 None\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 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    seed = generator.initial_seed() if generator is not None else 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        seed=seed,\n        out=out,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef poisson(input, generator=None):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.poisson(input, seed=seed, shape=None)\n\n\n@to_ivy_arrays_and_back\ndef randint(\n    low,\n    high,\n    size,\n    *,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.randint(\n        low,\n        high,\n        shape=size,\n        seed=seed,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@to_ivy_arrays_and_back\ndef rand(\n    *size,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False,\n    **kwargs,\n):\n    if not size and \"size\" not in kwargs:\n        raise ValueError(\"Missing 1 required positional/keyword argument: size\")\n    size = kwargs[\"size\"] if not size else size\n    if (\n        isinstance(size, (list, tuple))\n        and len(size) == 1\n        and isinstance(size[0], (list, tuple))\n    ):\n        size = size[0]\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.random_uniform(\n        shape=size,\n        seed=seed,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef normal(mean, std, *, generator=None, out=None):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.random_normal(mean=mean, std=std, seed=seed, out=out)\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    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False,\n    **kwargs,\n):\n    if not size and \"size\" not in kwargs:\n        raise ValueError(\"Missing 1 required positional/keyword argument: size\")\n    size = kwargs[\"size\"] if not size else size\n    if (\n        isinstance(size, (list, tuple))\n        and len(size) == 1\n        and isinstance(size[0], (list, tuple))\n    ):\n        size = size[0]\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.random_normal(\n        shape=size,\n        seed=seed,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@to_ivy_arrays_and_back\ndef randn_like(\n    input,\n    *,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    memory_format=None,\n):\n    shape = input.shape\n    if not dtype:\n        dtype = input.dtype\n\n    return ivy.random_normal(\n        shape=shape,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef bernoulli(input, *, generator=None, out=None):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.bernoulli(input, seed=seed, out=out)\n\n\n@to_ivy_arrays_and_back\ndef randperm(\n    n,\n    *,\n    generator=None,\n    out=None,\n    dtype=ivy.int64,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False,\n):\n    seed = generator.initial_seed() if generator is not None else None\n    arr = ivy.arange(n, device=device, dtype=dtype)\n    ret = ivy.shuffle(arr, seed=seed, out=out)\n    return ret\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\n\n# ToDo: will need to create a Generator class to be able to fully test these functions\n\n\ndef seed() -> int:\n    \"\"\"Return 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 None\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 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    seed = generator.initial_seed() if generator is not None else 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        seed=seed,\n        out=out,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef poisson(input, generator=None):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.poisson(input, seed=seed, shape=None)\n\n\n@to_ivy_arrays_and_back\ndef randint(\n    low,\n    high,\n    size,\n    *,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.randint(\n        low,\n        high,\n        shape=size,\n        seed=seed,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@to_ivy_arrays_and_back\ndef rand(\n    *size,\n    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False,\n    **kwargs,\n):\n    if not size and \"size\" not in kwargs:\n        raise ValueError(\"Missing 1 required positional/keyword argument: size\")\n    size = kwargs[\"size\"] if not size else size\n    if (\n        isinstance(size, (list, tuple))\n        and len(size) == 1\n        and isinstance(size[0], (list, tuple))\n    ):\n        size = size[0]\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.random_uniform(\n        shape=size,\n        seed=seed,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef normal(mean, std, *, generator=None, out=None):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.random_normal(mean=mean, std=std, seed=seed, out=out)\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    generator=None,\n    out=None,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False,\n    **kwargs,\n):\n    if not size and \"size\" not in kwargs:\n        raise ValueError(\"Missing 1 required positional/keyword argument: size\")\n    size = kwargs[\"size\"] if not size else size\n    if (\n        isinstance(size, (list, tuple))\n        and len(size) == 1\n        and isinstance(size[0], (list, tuple))\n    ):\n        size = size[0]\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.random_normal(\n        shape=size,\n        seed=seed,\n        out=out,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@to_ivy_arrays_and_back\ndef randn_like(\n    input,\n    *,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    memory_format=None,\n):\n    shape = input.shape\n    if not dtype:\n        dtype = input.dtype\n\n    return ivy.random_normal(\n        shape=shape,\n        dtype=dtype,\n        device=device,\n    )\n\n\n@with_supported_dtypes(\n    {\n        \"2.0.1 and below\": (\n            \"float32\",\n            \"float64\",\n        )\n    },\n    \"torch\",\n)\n@to_ivy_arrays_and_back\ndef bernoulli(input, *, generator=None, out=None):\n    seed = generator.initial_seed() if generator is not None else None\n    return ivy.bernoulli(input, seed=seed, out=out)\n\n\n@to_ivy_arrays_and_back\ndef randperm(\n    n,\n    *,\n    generator=None,\n    out=None,\n    dtype=ivy.int64,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    pin_memory=False,\n):\n    seed = generator.initial_seed() if generator is not None else None\n    arr = ivy.arange(n, device=device, dtype=dtype)\n    ret = ivy.shuffle(arr, seed=seed, out=out)\n    return ret\n\n\n@to_ivy_arrays_and_back\ndef randint_like(\n    input,\n    low,\n    high,\n    *,\n    dtype=None,\n    layout=None,\n    device=None,\n    requires_grad=False,\n    memory_format=None,\n):\n    shape = input.shape\n\n    return ivy.randint(\n        low,\n        high,\n        shape=shape,\n        device=device,\n        dtype=dtype,\n    )\n", "path": "ivy/functional/frontends/torch/random_sampling.py"}]}