prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Making `AudioMetaData` print friendly
  `AudioMetaData` class reports meta-data of audio source. It is however not print friendly.
  
  ```python
  print(torchaudio.info(src))
  >>> <torchaudio.backend.common.AudioMetaData object at 0x7f1bc5cd2890>
  ```
  
  It is nice if we can simply print the attributes like `dataclass` objects do.
  
  ```python
  print(torchaudio.info(src))
  >>> AudioMetaData(sample_rate=900, encoding="PCM", ...)
  ```
  
  ## Steps
  
  There are two approaches I can think of
  1. Add `__str__` method.
  2. Use `dataclasses.dataclass`
  
  For 2, the `info` function has to be TorchScript-compatible. This means that its return type `AudioMetaData` has to be TorchScript-able. For this reason, `dataclass` might not be applicable. This can be checked with the following test;
  
  ```bash
  (cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py)
  ```
  
  ## Build and test
  
  Please refer to the [contribution guide](https://github.com/pytorch/audio/blob/master/CONTRIBUTING.md) for how to setup development environment.
  
  To test, 
  
  ```bash
  (cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py torchaudio_unittest/backend/sox_io/info_test.py torchaudio_unittest/backend/soundfile_io/info_test.py)
  ```
  
  </issue>
  <code>
  [start of torchaudio/backend/common.py]
  1 class AudioMetaData:
  2     """Return type of ``torchaudio.info`` function.
  3 
  4     This class is used by :ref:`"sox_io" backend<sox_io_backend>` and
  5     :ref:`"soundfile" backend with the new interface<soundfile_backend>`.
  6 
  7     :ivar int sample_rate: Sample rate
  8     :ivar int num_frames: The number of frames
  9     :ivar int num_channels: The number of channels
  10     :ivar int bits_per_sample: The number of bits per sample. This is 0 for lossy formats,
  11         or when it cannot be accurately inferred.
  12     :ivar str encoding: Audio encoding
  13         The values encoding can take are one of the following:
  14 
  15             * ``PCM_S``: Signed integer linear PCM
  16             * ``PCM_U``: Unsigned integer linear PCM
  17             * ``PCM_F``: Floating point linear PCM
  18             * ``FLAC``: Flac, Free Lossless Audio Codec
  19             * ``ULAW``: Mu-law
  20             * ``ALAW``: A-law
  21             * ``MP3`` : MP3, MPEG-1 Audio Layer III
  22             * ``VORBIS``: OGG Vorbis
  23             * ``AMR_WB``: Adaptive Multi-Rate
  24             * ``AMR_NB``: Adaptive Multi-Rate Wideband
  25             * ``OPUS``: Opus
  26             * ``UNKNOWN`` : None of above
  27     """
  28     def __init__(
  29             self,
  30             sample_rate: int,
  31             num_frames: int,
  32             num_channels: int,
  33             bits_per_sample: int,
  34             encoding: str,
  35     ):
  36         self.sample_rate = sample_rate
  37         self.num_frames = num_frames
  38         self.num_channels = num_channels
  39         self.bits_per_sample = bits_per_sample
  40         self.encoding = encoding
  41
  [end of torchaudio/backend/common.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/torchaudio/backend/common.py b/torchaudio/backend/common.py
  --- a/torchaudio/backend/common.py
  +++ b/torchaudio/backend/common.py
  @@ -38,3 +38,14 @@
           self.num_channels = num_channels
           self.bits_per_sample = bits_per_sample
           self.encoding = encoding
  +
  +    def __str__(self):
  +        return (
  +            f"AudioMetaData("
  +            f"sample_rate={self.sample_rate}, "
  +            f"num_frames={self.num_frames}, "
  +            f"num_channels={self.num_channels}, "
  +            f"bits_per_sample={self.bits_per_sample}, "
  +            f"encoding={self.encoding}"
  +            f")"
  +        )
  
verification_info: {"golden_diff": "diff --git a/torchaudio/backend/common.py b/torchaudio/backend/common.py\n--- a/torchaudio/backend/common.py\n+++ b/torchaudio/backend/common.py\n@@ -38,3 +38,14 @@\n         self.num_channels = num_channels\n         self.bits_per_sample = bits_per_sample\n         self.encoding = encoding\n+\n+    def __str__(self):\n+        return (\n+            f\"AudioMetaData(\"\n+            f\"sample_rate={self.sample_rate}, \"\n+            f\"num_frames={self.num_frames}, \"\n+            f\"num_channels={self.num_channels}, \"\n+            f\"bits_per_sample={self.bits_per_sample}, \"\n+            f\"encoding={self.encoding}\"\n+            f\")\"\n+        )\n", "issue": "Making `AudioMetaData` print friendly\n`AudioMetaData` class reports meta-data of audio source. It is however not print friendly.\r\n\r\n```python\r\nprint(torchaudio.info(src))\r\n>>> <torchaudio.backend.common.AudioMetaData object at 0x7f1bc5cd2890>\r\n```\r\n\r\nIt is nice if we can simply print the attributes like `dataclass` objects do.\r\n\r\n```python\r\nprint(torchaudio.info(src))\r\n>>> AudioMetaData(sample_rate=900, encoding=\"PCM\", ...)\r\n```\r\n\r\n## Steps\r\n\r\nThere are two approaches I can think of\r\n1. Add `__str__` method.\r\n2. Use `dataclasses.dataclass`\r\n\r\nFor 2, the `info` function has to be TorchScript-compatible. This means that its return type `AudioMetaData` has to be TorchScript-able. For this reason, `dataclass` might not be applicable. This can be checked with the following test;\r\n\r\n```bash\r\n(cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py)\r\n```\r\n\r\n## Build and test\r\n\r\nPlease refer to the [contribution guide](https://github.com/pytorch/audio/blob/master/CONTRIBUTING.md) for how to setup development environment.\r\n\r\nTo test, \r\n\r\n```bash\r\n(cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py torchaudio_unittest/backend/sox_io/info_test.py torchaudio_unittest/backend/soundfile_io/info_test.py)\r\n```\n", "before_files": [{"content": "class AudioMetaData:\n    \"\"\"Return type of ``torchaudio.info`` function.\n\n    This class is used by :ref:`\"sox_io\" backend<sox_io_backend>` and\n    :ref:`\"soundfile\" backend with the new interface<soundfile_backend>`.\n\n    :ivar int sample_rate: Sample rate\n    :ivar int num_frames: The number of frames\n    :ivar int num_channels: The number of channels\n    :ivar int bits_per_sample: The number of bits per sample. This is 0 for lossy formats,\n        or when it cannot be accurately inferred.\n    :ivar str encoding: Audio encoding\n        The values encoding can take are one of the following:\n\n            * ``PCM_S``: Signed integer linear PCM\n            * ``PCM_U``: Unsigned integer linear PCM\n            * ``PCM_F``: Floating point linear PCM\n            * ``FLAC``: Flac, Free Lossless Audio Codec\n            * ``ULAW``: Mu-law\n            * ``ALAW``: A-law\n            * ``MP3`` : MP3, MPEG-1 Audio Layer III\n            * ``VORBIS``: OGG Vorbis\n            * ``AMR_WB``: Adaptive Multi-Rate\n            * ``AMR_NB``: Adaptive Multi-Rate Wideband\n            * ``OPUS``: Opus\n            * ``UNKNOWN`` : None of above\n    \"\"\"\n    def __init__(\n            self,\n            sample_rate: int,\n            num_frames: int,\n            num_channels: int,\n            bits_per_sample: int,\n            encoding: str,\n    ):\n        self.sample_rate = sample_rate\n        self.num_frames = num_frames\n        self.num_channels = num_channels\n        self.bits_per_sample = bits_per_sample\n        self.encoding = encoding\n", "path": "torchaudio/backend/common.py"}]}