prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  rand_like
  
  
  </issue>
  <code>
  [start of ivy/functional/frontends/torch/random_sampling.py]
  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 of ivy/functional/frontends/torch/random_sampling.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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,
  
verification_info: {"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"}]}