class_docstr: Transition layer to reduce spatial resolution.
code: def __init__(self, in_planes, out_planes, reduction=2):
      # assertions:
      assert is_pos_int(in_planes)
      assert is_pos_int(out_planes)
      assert is_pos_int(reduction)
  
      # create layers for pooling:
      super(_Transition, self).__init__()
      self.add_module("pool-norm", nn.BatchNorm2d(in_planes))
      self.add_module("pool-relu", nn.ReLU(inplace=INPLACE))
      self.add_module(
          "pool-conv",
          nn.Conv2d(
              in_planes, out_planes, kernel_size=1, stride=1, bias=False
          ),
      )
      self.add_module(
          "pool-pool",
          nn.AvgPool2d(kernel_size=reduction, stride=reduction),
      )
  
imports: import math
  from collections import OrderedDict
  from typing import Any, Dict, Sequence
  import torch
  import torch.nn
  from classy_vision.generic.util import is_pos_int
  from .None import register_model
  from .classy_model import ClassyModel
  from .squeeze_and_excitation_layer import SqueezeAndExcitationLayer
label_desc: Use image node_id 1 to create a new _Transition object from inherited base classes: nn with example: obj = _Transition(in_planes, out_planes, reduction)