import torch


def load_model(load_path, net, device):
    """ Loads a stored network with pytorch. """
    checkpoint = torch.load(load_path, map_location=device)
    net.load_state_dict(checkpoint)
    net.to(device)
    net.eval()
    return net