def _swap_ema_parameters(self):
        """Swap the parameter of model with parameter in ema_buffer."""
        for name, value in self.model_parameters.items():
            temp = value.data.clone()
            ema_buffer = self.model_buffers[self.param_ema_buffer[name]]
            value.data.copy_(ema_buffer.data)
            ema_buffer.data.copy_(temp)
Swap the parameter of model with parameter in ema_buffer.
ControlNet-v1-1-nightly/annotator/uniformer/mmcv/runner/hooks/ema.py