Open ShHsLin opened 4 years ago
Thanks for your finding, I will get back to this problem soon.
The problem appears when one calls method _distributed_apply, which is not modified in QGOpt. There is a short guide on how to implement subclasses of the class Optimizer here https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/training/optimizer.py, and it is not clear for now what to do with _distributed_apply.
I encounter a problem regarding using optimizer with tf.function. It seems that the optimizer would not work under tf.function decoration. I attach a simple example showing the behaviour.
If one remove the @tf.function in front of one_step, the code works. Also one use the normal optimizer, i.e. tf.optimizers, the code would works.
I wonder if there is anything underlying make the autograph tracing broken.
would show