code: def __init__(
      self,
      block,
      expansion,
      layers,
      p=0.0,
      c_in=3,
      n_out=1000,
      stem_szs=(32, 32, 64),
      widen=1.0,
      sa=False,
      act_cls=defaults.activation,
      ndim=2,
      ks=3,
      stride=2,
      **kwargs,
  ):
      store_attr("block,expansion,act_cls,ndim,ks")
      if ks % 2 == 0:
          raise Exception("kernel size has to be odd!")
      stem_szs = [c_in, *stem_szs]
      stem = [
          ConvLayer(
              stem_szs[i],
              stem_szs[i + 1],
              ks=ks,
              stride=stride if i == 0 else 1,
              act_cls=act_cls,
              ndim=ndim,
          )
          for i in range(3)
      ]
  
      block_szs = [
          int(o * widen)
          for o in [64, 128, 256, 512] + [256] * (len(layers) - 4)
      ]
      block_szs = [64 // expansion] + block_szs
      blocks = self._make_blocks(
          layers, block_szs, sa, stride, **kwargs
      )
  
      super().__init__(
          *stem,
          MaxPool(ks=ks, stride=stride, padding=ks // 2, ndim=ndim),
          *blocks,
          AdaptiveAvgPool(sz=1, ndim=ndim),
          Flatten(),
          nn.Dropout(p),
          nn.Linear(block_szs[-1] * expansion, n_out),
      )
      init_cnn(self)
  
imports: from __future__ import annotations
  from ...torch_basics import *
label_desc: Use image node_id 1 to create a new XResNet object from inherited base classes: nn with example: obj = XResNet(block, expansion, layers, p, c_in, n_out, stem_szs, widen, sa, act_cls, ndim, ks, stride)