prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  propagate_guide() of Encoder raises a TypeError
  When running the replication of [Gatys et al. 2017](https://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/replication/gatys_et_al_2017.py#L254), the following error is raised:
  
  ```
  TypeError: Unions cannot be used with isinstance().
  ```
  
  This points towards the [Encoder](https://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/pystiche/encoding/encoder.py#L12), specifically these `if` statements in the `propagate_guide()` method:
  
  https://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/pystiche/encoding/encoder.py#L50-L53
  
  `PoolModule` and `ConvModule` are defined in `pystiche.typing`:
  
  https://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/pystiche/typing.py#L18-L23
  
  
  </issue>
  <code>
  [start of pystiche/typing.py]
  1 from typing import Union, Sequence
  2 import torch
  3 from torch import nn
  4 
  5 __all__ = [
  6     "Numeric",
  7     "TensorMeta",
  8     "ConvModule",
  9     "ConvModuleMeta",
  10     "PoolModule",
  11     "PoolModuleMeta",
  12 ]
  13 
  14 Numeric = Union[int, float]
  15 
  16 TensorMeta = Union[torch.device, torch.dtype]
  17 
  18 ConvModule = Union[nn.Conv1d, nn.Conv2d, nn.Conv2d]
  19 ConvModuleMeta = Union[int, Sequence[int]]
  20 
  21 PoolModule = Union[
  22     nn.AvgPool1d, nn.AvgPool2d, nn.AvgPool3d, nn.MaxPool1d, nn.MaxPool2d, nn.MaxPool3d
  23 ]
  24 PoolModuleMeta = Union[int, Sequence[int]]
  25
  [end of pystiche/typing.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/pystiche/typing.py b/pystiche/typing.py
  --- a/pystiche/typing.py
  +++ b/pystiche/typing.py
  @@ -1,4 +1,4 @@
  -from typing import Union, Sequence
  +from typing import Union, Any, Sequence
   import torch
   from torch import nn
   
  @@ -6,8 +6,10 @@
       "Numeric",
       "TensorMeta",
       "ConvModule",
  +    "is_conv_module",
       "ConvModuleMeta",
       "PoolModule",
  +    "is_pool_module",
       "PoolModuleMeta",
   ]
   
  @@ -15,10 +17,32 @@
   
   TensorMeta = Union[torch.device, torch.dtype]
   
  -ConvModule = Union[nn.Conv1d, nn.Conv2d, nn.Conv2d]
  +ConvModule = Union[nn.Conv1d, nn.Conv2d, nn.Conv3d]
  +
  +
  +def is_conv_module(x: Any) -> bool:
  +    return isinstance(x, (nn.Conv1d, nn.Conv2d, nn.Conv3d))
  +
  +
   ConvModuleMeta = Union[int, Sequence[int]]
   
   PoolModule = Union[
       nn.AvgPool1d, nn.AvgPool2d, nn.AvgPool3d, nn.MaxPool1d, nn.MaxPool2d, nn.MaxPool3d
   ]
  +
  +
  +def is_pool_module(x: Any) -> bool:
  +    return isinstance(
  +        x,
  +        (
  +            nn.AvgPool1d,
  +            nn.AvgPool2d,
  +            nn.AvgPool3d,
  +            nn.MaxPool1d,
  +            nn.MaxPool2d,
  +            nn.MaxPool3d,
  +        ),
  +    )
  +
  +
   PoolModuleMeta = Union[int, Sequence[int]]
  
verification_info: {"golden_diff": "diff --git a/pystiche/typing.py b/pystiche/typing.py\n--- a/pystiche/typing.py\n+++ b/pystiche/typing.py\n@@ -1,4 +1,4 @@\n-from typing import Union, Sequence\n+from typing import Union, Any, Sequence\n import torch\n from torch import nn\n \n@@ -6,8 +6,10 @@\n     \"Numeric\",\n     \"TensorMeta\",\n     \"ConvModule\",\n+    \"is_conv_module\",\n     \"ConvModuleMeta\",\n     \"PoolModule\",\n+    \"is_pool_module\",\n     \"PoolModuleMeta\",\n ]\n \n@@ -15,10 +17,32 @@\n \n TensorMeta = Union[torch.device, torch.dtype]\n \n-ConvModule = Union[nn.Conv1d, nn.Conv2d, nn.Conv2d]\n+ConvModule = Union[nn.Conv1d, nn.Conv2d, nn.Conv3d]\n+\n+\n+def is_conv_module(x: Any) -> bool:\n+    return isinstance(x, (nn.Conv1d, nn.Conv2d, nn.Conv3d))\n+\n+\n ConvModuleMeta = Union[int, Sequence[int]]\n \n PoolModule = Union[\n     nn.AvgPool1d, nn.AvgPool2d, nn.AvgPool3d, nn.MaxPool1d, nn.MaxPool2d, nn.MaxPool3d\n ]\n+\n+\n+def is_pool_module(x: Any) -> bool:\n+    return isinstance(\n+        x,\n+        (\n+            nn.AvgPool1d,\n+            nn.AvgPool2d,\n+            nn.AvgPool3d,\n+            nn.MaxPool1d,\n+            nn.MaxPool2d,\n+            nn.MaxPool3d,\n+        ),\n+    )\n+\n+\n PoolModuleMeta = Union[int, Sequence[int]]\n", "issue": "propagate_guide() of Encoder raises a TypeError\nWhen running the replication of [Gatys et al. 2017](https://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/replication/gatys_et_al_2017.py#L254), the following error is raised:\r\n\r\n```\r\nTypeError: Unions cannot be used with isinstance().\r\n```\r\n\r\nThis points towards the [Encoder](https://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/pystiche/encoding/encoder.py#L12), specifically these `if` statements in the `propagate_guide()` method:\r\n\r\nhttps://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/pystiche/encoding/encoder.py#L50-L53\r\n\r\n`PoolModule` and `ConvModule` are defined in `pystiche.typing`:\r\n\r\nhttps://github.com/pmeier/pystiche/blob/3260b68ea8dd88de433777ad3750d7abe3894743/pystiche/typing.py#L18-L23\r\n\n", "before_files": [{"content": "from typing import Union, Sequence\nimport torch\nfrom torch import nn\n\n__all__ = [\n    \"Numeric\",\n    \"TensorMeta\",\n    \"ConvModule\",\n    \"ConvModuleMeta\",\n    \"PoolModule\",\n    \"PoolModuleMeta\",\n]\n\nNumeric = Union[int, float]\n\nTensorMeta = Union[torch.device, torch.dtype]\n\nConvModule = Union[nn.Conv1d, nn.Conv2d, nn.Conv2d]\nConvModuleMeta = Union[int, Sequence[int]]\n\nPoolModule = Union[\n    nn.AvgPool1d, nn.AvgPool2d, nn.AvgPool3d, nn.MaxPool1d, nn.MaxPool2d, nn.MaxPool3d\n]\nPoolModuleMeta = Union[int, Sequence[int]]\n", "path": "pystiche/typing.py"}]}