code: def _reload(model):
      dirname = tempfile.mkdtemp()
  
      try:
          fname = os.path.join(dirname, "model.pkl")
  
          torch.save(model, fname)
          model = torch.load(fname)
  
      finally:
          shutil.rmtree(dirname)
  
      return model
  
file_path: spotlight/tests/test_serialization.py
imports: import os
  import shutil
  import tempfile
  import numpy
  import pytest
  import torch
  from spotlight.cross_validation import random_train_test_split
  from spotlight.datasets import movielens
  from spotlight.evaluation import mrr_score, sequence_mrr_score
  from spotlight.evaluation import rmse_score
  from spotlight.factorization.explicit import ExplicitFactorizationModel
  from spotlight.factorization.implicit import ImplicitFactorizationModel
  from spotlight.sequence.implicit import ImplicitSequenceModel
  from spotlight.sequence.representations import CNNNet
label_desc: Use image node_id 1 for calling a global function with example usage: _reload(model) and returns: model