def polyak_update(polyak_factor, target_network, network):
    for target_param, param in zip(target_network.parameters(), network.parameters()):
        target_param.data.copy_(polyak_factor*param.data + target_param.data*(1.0 - polyak_factor))

Source: https://github.com/navneet-nmk/pytorch-rl/blob/master/train_ddpg.py 314