class_docstr: Hourglass model from Newell et al ECCV 2016.
class_docstr_tok: ["Hourglass","model","from","Newell","et","al","ECCV","2016","."]
code: def _make_residual(
      self,
      block: Type[Bottleneck2D],
      planes: int,
      blocks: int,
      stride: Union[int, Tuple[int, int]] = 1,
  ) -> Module:
      downsample = None
      if stride != 1 or self.inplanes != planes * self.expansion:
          downsample = nn.Sequential(
              nn.Conv2d(
                  self.inplanes,
                  planes * self.expansion,
                  kernel_size=1,
                  stride=stride,
              )
          )
  
      layers = []
      layers.append(block(self.inplanes, planes, stride, downsample))
      self.inplanes = planes * self.expansion
      for _ in range(1, blocks):
          layers.append(block(self.inplanes, planes))
  
      return nn.Sequential(*layers)
  
imports: from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Type, Union
  import torch
  import torch.nn.functional
  from torch import nn
  from torch.nn.functional import pixel_shuffle, softmax
  from kornia.core import Module, Tensor
label_desc: Use image node_id 2 for calling the HourglassNet obj's underlying member method code with example usage: obj._make_residual(block, planes, blocks, stride) and returns: nn