def accumulate(self, grads, trainable_variables):
        """Accumulates :obj:`gradients` on the current replica."""
        if not self.built:
            self.build(trainable_variables)
        # return [None if x is None else x if y is None else x + y for x, y in zip(gradients, per_ga_gradients)]
        acc_grads = self._get_acc_grads(trainable_variables)
        new_g_accs = [(g + acc_g) for g, acc_g in zip(grads, acc_grads)]
        for n_g_acc, g_acc in zip(new_g_accs, acc_grads):
            g_acc.assign(n_g_acc)
Accumulates :obj:`gradients` on the current replica.
tensorflow_asr/optimizers/accumulation.py