code: def __init__(self, in_channels, with_conv):
      super().__init__()
      self.with_conv = with_conv
      if self.with_conv:
          # no asymmetric padding in torch conv, must do it ourselves
          self.conv = torch.nn.Conv2d(
              in_channels,
              in_channels,
              kernel_size=3,
              stride=2,
              padding=0,
          )
  
imports: import logging
  import math
  from typing import Any, Callable, Optional
  import numpy
  import torch
  import torch.nn
  from einops import rearrange
  from packaging import version
  from ...modules.attention import LinearAttention, MemoryEfficientCrossAttention
label_desc: Use image node_id 1 to create a new Downsample object from inherited base classes: nn with example: obj = Downsample(in_channels, with_conv)