code: def __init__(self, in_chs, out_chs, stride=1, dilation=1):
      super().__init__()
      avg_stride = stride if dilation == 1 else 1
      if stride > 1 or dilation > 1:
          avg_pool_fn = (
              AvgPool2dSame
              if avg_stride == 1 and dilation > 1
              else nn.AvgPool2d
          )
          self.pool = avg_pool_fn(
              2, avg_stride, ceil_mode=True, count_include_pad=False
          )
      else:
          self.pool = nn.Identity()
  
      if in_chs != out_chs:
          self.conv = create_conv2d(in_chs, out_chs, 1, stride=1)
      else:
          self.conv = nn.Identity()
  
imports: from collections import OrderedDict
  from functools import partial
  from typing import Callable, Optional, Tuple, Union
  import torch
  import torch.nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, OPENAI_CLIP_MEAN, OPENAI_CLIP_STD
  from timm.layers import trunc_normal_, AvgPool2dSame, DropPath, Mlp, GlobalResponseNormMlp, LayerNorm2d, LayerNorm, create_conv2d, get_act_layer, make_divisible, to_ntuple
  from timm.layers import NormMlpClassifierHead, ClassifierHead
  from ._builder import build_model_with_cfg
  from ._manipulate import named_apply, checkpoint_seq
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 1 to create a new Downsample object from inherited base classes: nn with example: obj = Downsample(in_chs, out_chs, stride, dilation)