def numpy_to_torch(weights, device):
    """
    Convert numpy weights to torch tensors and move them to the specified device.
    :params:
        weights: numpy weights
        device: torch device
    :return:
        torch_weights: weights in torch tensor
    """
    torch_weights = {}
    for k in weights.keys():
        torch_weights[k] = torch.from_numpy(weights[k]).to(device)
    return torch_weights

    Convert numpy weights to torch tensors and move them to the specified device.
    :params:
        weights: numpy weights
        device: torch device
    :return:
        torch_weights: weights in torch tensor
    
metadrive/examples/ppo_expert/torch_expert.py