Allow loss to be passed as a Tensor to Optimizer.minimize

PiperOrigin-RevId: 323895500
This commit is contained in:
Thomas O'Malley 2020-07-29 16:44:00 -07:00 committed by Steve Chien
parent cea9e01670
commit d5e34b77c8

View file

@ -151,7 +151,7 @@ class TestOptimizer(OptimizerV2):
self.iterations = tf.constant(1, dtype=tf.float32) self.iterations = tf.constant(1, dtype=tf.float32)
self._iterations = tf.constant(1, dtype=tf.float32) self._iterations = tf.constant(1, dtype=tf.float32)
def _compute_gradients(self, loss, var_list, grad_loss=None): def _compute_gradients(self, loss, var_list, grad_loss=None, tape=None):
return 'test' return 'test'
def get_config(self): def get_config(self):