code: def load_cpc_model(
      checkpoint_path: str, layer: int = 2
  ) -> torch.nn.Module:
      state_dict = torch.load(checkpoint_path)
      weights = state_dict["weights"]
      config = state_dict["config"]
      if layer is not None:
          config["nLevelsGRU"] = layer
  
      encoder = CPCEncoder(config["hiddenEncoder"])
      ar_net = CPCAR(
          config["hiddenEncoder"],
          config["hiddenGar"],
          False,
          config["nLevelsGRU"],
      )
  
      model = CPCModel(encoder, ar_net)
      model.load_state_dict(weights, strict=False)
      model.config = config
  
      return model
  
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 6 for calling the CpcFeatureReader obj's underlying member method code with example usage: obj.load_cpc_model(checkpoint_path, layer) and returns: model