code: def _resnet(
      pretrained: bool = False,
      progress: bool = True,
      checkpoint_path: str = "",
      model_builder: Callable = create_resnet,
      **kwargs: Any,
  ) -> nn.Module:
      model = model_builder(**kwargs)
      if pretrained:
          # All models are loaded onto CPU by default
          checkpoint = load_state_dict_from_url(
              checkpoint_path, progress=progress, map_location="cpu"
          )
          state_dict = checkpoint["model_state"]
          model.load_state_dict(state_dict)
      return model
  
file_path: pytorchvideo/pytorchvideo/models/hub/resnet.py
imports: from typing import Any, Callable
  import torch.nn
  from pytorchvideo.models.resnet import create_resnet, create_resnet_with_roi_head
  from torch.hub import load_state_dict_from_url
label_desc: Use image node_id 1 for calling a global function with example usage: _resnet(pretrained, progress, checkpoint_path, model_builder) and returns: model