def update_moving_average(ema_updater, ma_model, current_model):
    for (current_params, ma_params) in zip(current_model.parameters(), ma_model.parameters()):
        (old_weight, up_weight) = (ma_params.data, current_params.data)
        ma_params.data = ema_updater.update_average(old_weight, up_weight)
def update_moving_average(ema_updater, ma_model, current_model):
    for (current_params, ma_params) in zip(current_model.parameters(), ma_model.parameters()):
        (old_weight, up_weight) = (ma_params.data, current_params.data)
        ma_params.data = ema_updater.update_average(old_weight, up_weight)