from tensorflow.python.framework import ops

    def __init__(self, learning_rate=0.001, use_locking=False, name="OMD"):
        super(OptimisticMirrorDescentOptimizer, self).__init__(use_locking,
                                                               name)
        self._lr = learning_rate
        # Tensor versions of the constructor arguments, created in _prepare().
        self._lr_t = None

    def _prepare(self):
        self._lr_t = ops.convert_to_tensor(self._lr, name="learning_rate")

    def _create_slots(self, var_list):
        # Create slots for the first and second moments.
        for v in var_list:
            self._zeros_slot(v, "g", self._name)

    def _apply_dense(self, grad, var):
