class_docstr: Original implementation: https://github.com/princeton-vl/pytorch_stacked_hourglass/blob/master/models/layers.py
code: def __init__(
      self,
      input_channels: int = 3,
      stack_level: int = 8,
      depth: int = 4,
      features: int = 256,
      activation=ACT_RELU,
      repeats=1,
      pooling_block=nn.MaxPool2d,
  ):
      super().__init__(
          channels=[features] + [features] * stack_level,
          strides=[4] + [4] * stack_level,
          layers=list(range(0, stack_level + 1)),
      )
  
      self.stack_level = stack_level
      self.depth_level = depth
      self.num_features = features
  
      act = get_activation_block(activation)
      self.stem = HGStemBlock(input_channels, features, activation=act)
  
      input_features = features
      modules = []
  
      for _ in range(stack_level):
          modules.append(
              HGBlock(
                  depth,
                  input_features,
                  features,
                  increase=0,
                  activation=act,
                  repeats=repeats,
                  pooling_block=pooling_block,
              )
          )
          input_features = features
  
      self.num_blocks = len(modules)
      self.blocks = nn.ModuleList(modules)
      self.features = nn.ModuleList(
          [
              HGFeaturesBlock(features, blocks=4, activation=act)
              for _ in range(stack_level)
          ]
      )
      self.merge_features = nn.ModuleList(
          [
              nn.Conv2d(features, features, kernel_size=1)
              for _ in range(stack_level - 1)
          ]
      )
  
imports: import inspect
  from collections import OrderedDict
  from typing import List, Callable, Tuple
  import torch
  from pytorch_toolbelt.modules import ACT_RELU, get_activation_block
  from pytorch_toolbelt.modules.encoders import EncoderModule, make_n_channel_input
  from torch import nn, Tensor
label_desc: Use image node_id 1 to create a new StackedHGEncoder object from inherited base classes: EncoderModule with example: obj = StackedHGEncoder(input_channels, stack_level, depth, features, activation, repeats, pooling_block)