def apply_gradients(self, grads_and_vars, global_step=None, name=None):
    assert self._was_dp_gradients_called, 'Neither _compute_gradients() or get_gradients() on the differentially private optimizer was called. This means the training is not differentially private. It may be the case that you need to upgrade to TF 2.4 or higher to use this particular optimizer.'
    return super(DPOptimizerClass, self).apply_gradients(grads_and_vars, global_step, name)
def apply_gradients(self, grads_and_vars, global_step=None, name=None):
    assert self._was_dp_gradients_called, 'Neither _compute_gradients() or get_gradients() on the differentially private optimizer was called. This means the training is not differentially private. It may be the case that you need to upgrade to TF 2.4 or higher to use this particular optimizer.'
    return super(DPOptimizerClass, self).apply_gradients(grads_and_vars, global_step, name)