code: def _xresnet(pretrained, expansion, layers, **kwargs):
      # TODO pretrain all sizes. Currently will fail with non-xrn50
      url = "https://s3.amazonaws.com/fast-ai-modelzoo/xrn50_940.pth"
      res = XResNet(ResBlock, expansion, layers, **kwargs)
      if pretrained:
          res.load_state_dict(
              load_state_dict_from_url(url, map_location="cpu")[
                  "model"
              ],
              strict=False,
          )
      return res
  
imports: from __future__ import annotations
  from ...torch_basics import *
label_desc: Use image node_id 2 for calling a global function with example usage: _xresnet(pretrained, expansion, layers) and returns: res