prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Missing packaging dependency in torch 2.1.x
  ### 🐛 Describe the bug
  
  Hi,
  [torch.utils.tensorboard requires "packaging"](https://github.com/pytorch/pytorch/blob/fa1ccc34c4f65756bc50c3e3ab135c88b175b18c/torch/utils/tensorboard/__init__.py#L2C1-L3C1) to be installed but that dependency is [missing on torch 2.1.x](https://github.com/pytorch/pytorch/blob/v2.1.2-rc1/requirements.txt).
  
  Here's some example code:
  ```python
  from torch.utils.tensorboard import SummaryWriter
  ```
  
  The links above point to a RC version of 2.1.2 but this is also the case for 2.1.1. Would it be possible to make a patch release to add the dependency?
  
  ### Versions
  
  Python version: 3.9.16 (main, Dec  7 2022, 10:16:11)  [Clang 14.0.0 (clang-140[0.0.29.202](http://0.0.29.202/)
  )] (64-bit runtime)
  Python platform: macOS-13.6.1-x86_64-i386-64bit
  Is CUDA available: False
  CUDA runtime version: No CUDA
  CUDA_MODULE_LOADING set to: N/A
  GPU models and configuration: No CUDA
  Nvidia driver version: No CUDA
  cuDNN version: No CUDA
  HIP runtime version: N/A
  MIOpen runtime version: N/A
  Is XNNPACK available: True
  
  CPU:
  Intel(R) Core(TM) i5-7287U CPU @ 3.30GHz
  
  Versions of relevant libraries:
  [pip3] numpy==1.23.5
  [pip3] torch==2.1.1
  [pip3] torchvision==0.16.1
  [conda] Could not collect
  
  </issue>
  <code>
  [start of torch/utils/tensorboard/__init__.py]
  1 import tensorboard
  2 from packaging.version import Version
  3 
  4 if not hasattr(tensorboard, "__version__") or Version(
  5     tensorboard.__version__
  6 ) < Version("1.15"):
  7     raise ImportError("TensorBoard logging requires TensorBoard version 1.15 or above")
  8 
  9 del Version
  10 del tensorboard
  11 
  12 from .writer import FileWriter, SummaryWriter  # noqa: F401
  13 from tensorboard.summary.writer.record_writer import RecordWriter  # noqa: F401
  14
  [end of torch/utils/tensorboard/__init__.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/torch/utils/tensorboard/__init__.py b/torch/utils/tensorboard/__init__.py
  --- a/torch/utils/tensorboard/__init__.py
  +++ b/torch/utils/tensorboard/__init__.py
  @@ -1,5 +1,5 @@
   import tensorboard
  -from packaging.version import Version
  +from torch._vendor.packaging.version import Version
   
   if not hasattr(tensorboard, "__version__") or Version(
       tensorboard.__version__
  
verification_info: {"golden_diff": "diff --git a/torch/utils/tensorboard/__init__.py b/torch/utils/tensorboard/__init__.py\n--- a/torch/utils/tensorboard/__init__.py\n+++ b/torch/utils/tensorboard/__init__.py\n@@ -1,5 +1,5 @@\n import tensorboard\n-from packaging.version import Version\n+from torch._vendor.packaging.version import Version\n \n if not hasattr(tensorboard, \"__version__\") or Version(\n     tensorboard.__version__\n", "issue": "Missing packaging dependency in torch 2.1.x\n### \ud83d\udc1b Describe the bug\n\nHi,\r\n[torch.utils.tensorboard requires \"packaging\"](https://github.com/pytorch/pytorch/blob/fa1ccc34c4f65756bc50c3e3ab135c88b175b18c/torch/utils/tensorboard/__init__.py#L2C1-L3C1) to be installed but that dependency is [missing on torch 2.1.x](https://github.com/pytorch/pytorch/blob/v2.1.2-rc1/requirements.txt).\r\n\r\nHere's some example code:\r\n```python\r\nfrom torch.utils.tensorboard import SummaryWriter\r\n```\r\n\r\nThe links above point to a RC version of 2.1.2 but this is also the case for 2.1.1. Would it be possible to make a patch release to add the dependency?\n\n### Versions\n\nPython version: 3.9.16 (main, Dec  7 2022, 10:16:11)  [Clang 14.0.0 (clang-140[0.0.29.202](http://0.0.29.202/)\r\n)] (64-bit runtime)\r\nPython platform: macOS-13.6.1-x86_64-i386-64bit\r\nIs CUDA available: False\r\nCUDA runtime version: No CUDA\r\nCUDA_MODULE_LOADING set to: N/A\r\nGPU models and configuration: No CUDA\r\nNvidia driver version: No CUDA\r\ncuDNN version: No CUDA\r\nHIP runtime version: N/A\r\nMIOpen runtime version: N/A\r\nIs XNNPACK available: True\r\n\r\nCPU:\r\nIntel(R) Core(TM) i5-7287U CPU @ 3.30GHz\r\n\r\nVersions of relevant libraries:\r\n[pip3] numpy==1.23.5\r\n[pip3] torch==2.1.1\r\n[pip3] torchvision==0.16.1\r\n[conda] Could not collect\n", "before_files": [{"content": "import tensorboard\nfrom packaging.version import Version\n\nif not hasattr(tensorboard, \"__version__\") or Version(\n    tensorboard.__version__\n) < Version(\"1.15\"):\n    raise ImportError(\"TensorBoard logging requires TensorBoard version 1.15 or above\")\n\ndel Version\ndel tensorboard\n\nfrom .writer import FileWriter, SummaryWriter  # noqa: F401\nfrom tensorboard.summary.writer.record_writer import RecordWriter  # noqa: F401\n", "path": "torch/utils/tensorboard/__init__.py"}]}