mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 12:20:11 +01:00
Update custom_gradient.py
Added error raised when executing eagerly . Fixes https://github.com/tensorflow/tensorflow/issues/29275
This commit is contained in:
parent
0bedfb5781
commit
6172fb6de0
|
|
@ -201,6 +201,10 @@ def custom_gradient(f=None):
|
|||
Returns:
|
||||
A function `h(x)` which returns the same value as `f(x)[0]` and whose
|
||||
gradient (as calculated by `tf.gradients`) is determined by `f(x)[1]`.
|
||||
|
||||
Raises:
|
||||
RuntimeError: tf.gradients is not supported when eager execution is
|
||||
enabled. Use tf.GradientTape instead.
|
||||
"""
|
||||
|
||||
if f is None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user